GDCM  2.2.6
gdcmULEvent.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef GDCMULEVENT_H
19 #define GDCMULEVENT_H
20 
21 #include "gdcmNetworkStateID.h"
22 #include "gdcmNetworkEvents.h"
23 #include "gdcmBasePDU.h"
24 #include <vector>
25 
26 namespace gdcm {
27  namespace network {
28 
37 class ULEvent {
38  EEventID mEvent;
39  std::vector<BasePDU*> mBasePDU;
40 
41  void DeletePDUVector(){
42  std::vector<BasePDU*>::iterator baseItor;
43  for (baseItor = mBasePDU.begin(); baseItor < mBasePDU.end(); baseItor++){
44  if (*baseItor != NULL){
45  delete *baseItor;
46  *baseItor = NULL;
47  }
48  }
49  }
50 
51  public:
52  ULEvent(const EEventID& inEventID, std::vector<BasePDU*> const & inBasePDU){
53  mEvent = inEventID;
54  mBasePDU = inBasePDU;
55  }
56  ULEvent(const EEventID& inEventID, BasePDU* inBasePDU){
57  mEvent = inEventID;
58  mBasePDU.push_back(inBasePDU);
59  }
61  DeletePDUVector();
62  }
63 
64  EEventID GetEvent() const { return mEvent; }
65  std::vector<BasePDU*> const & GetPDUs() const { return mBasePDU; }
66 
67  void SetEvent(const EEventID& inEvent) { mEvent = inEvent; }
68  void SetPDU(std::vector<BasePDU*> const & inPDU) {
69  DeletePDUVector();
70  mBasePDU = inPDU;
71  }
72  };
73  }
74 }
75 
76 #endif //GDCMULEVENT_H
EEventID GetEvent() const
Definition: gdcmULEvent.h:64
std::vector< BasePDU * > const & GetPDUs() const
Definition: gdcmULEvent.h:65
void SetEvent(const EEventID &inEvent)
Definition: gdcmULEvent.h:67
BasePDU base class for PDUs.
Definition: gdcmBasePDU.h:50
ULEvent base class for network events.
Definition: gdcmULEvent.h:37
~ULEvent()
Definition: gdcmULEvent.h:60
EEventID
Definition: gdcmNetworkEvents.h:33
ULEvent(const EEventID &inEventID, std::vector< BasePDU * > const &inBasePDU)
Definition: gdcmULEvent.h:52
ULEvent(const EEventID &inEventID, BasePDU *inBasePDU)
Definition: gdcmULEvent.h:56
void SetPDU(std::vector< BasePDU * > const &inPDU)
Definition: gdcmULEvent.h:68

Generated on Sat Dec 21 2013 05:56:18 for GDCM by doxygen 1.8.5
SourceForge.net Logo