GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

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*> inBasePDU){
53 mEvent = inEventID;
54 mBasePDU = inBasePDU;
55 }
56 ULEvent(const EEventID& inEventID, BasePDU* inBasePDU){
57 mEvent = inEventID;
58 mBasePDU.push_back(inBasePDU);
59 }
60 ~ULEvent(){
61 DeletePDUVector();
62 }
63
64 EEventID GetEvent() const { return mEvent; }
65 std::vector<BasePDU*> GetPDUs() const { return mBasePDU; }
66
67 void SetEvent(const EEventID& inEvent) { mEvent = inEvent; }
68 void SetPDU(std::vector<BasePDU*> inPDU) {
69 DeletePDUVector();
70 mBasePDU = inPDU;
71 }
72 };
73 }
74 }
75
76 #endif //GDCMULEVENT_H