GDCM 3.2.1

gdcmULEvent.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 std::istream * m_pStream ;
41 std::streampos m_posDataSet ;
42 void DeletePDUVector(){
43 std::vector<BasePDU*>::iterator baseItor;
44 for (baseItor = mBasePDU.begin(); baseItor < mBasePDU.end(); baseItor++){
45 if (*baseItor != nullptr){
46 delete *baseItor;
47 *baseItor = nullptr;
48 }
49 }
50 }
51
52 public:
53 ULEvent(const EEventID& inEventID, std::vector<BasePDU*> inBasePDU, std::istream * iStream = nullptr, std::streampos posDataSet = 0 ){
54 mEvent = inEventID;
55 mBasePDU = inBasePDU;
56 m_pStream = iStream ;
57 m_posDataSet = posDataSet ;
58 }
59 ULEvent(const EEventID& inEventID, BasePDU* inBasePDU, std::istream * iStream = nullptr, std::streampos posDataSet = 0 ){
60 mEvent = inEventID;
61 mBasePDU.push_back(inBasePDU);
62 m_pStream = iStream ;
63 m_posDataSet = posDataSet ;
64 }
65 ~ULEvent(){
66 DeletePDUVector();
67 }
68
69 EEventID GetEvent() const { return mEvent; }
70 std::vector<BasePDU*> const & GetPDUs() const { return mBasePDU; }
71 std::istream * GetIStream() const { return m_pStream; }
72 std::streampos GetDataSetPos() const { return m_posDataSet; }
73
74 void SetEvent(const EEventID& inEvent) { mEvent = inEvent; }
75 void SetPDU(std::vector<BasePDU*> const & inPDU) {
76 DeletePDUVector();
77 mBasePDU = inPDU;
78 }
79 };
80 }
81}
82
83#endif //GDCMULEVENT_H
gdcm::network::BasePDU
BasePDU.
Definition gdcmBasePDU.h:51
gdcm::network::ULEvent::GetIStream
std::istream * GetIStream() const
Definition gdcmULEvent.h:71
gdcm::network::ULEvent::SetEvent
void SetEvent(const EEventID &inEvent)
Definition gdcmULEvent.h:74
gdcm::network::ULEvent::GetEvent
EEventID GetEvent() const
Definition gdcmULEvent.h:69
gdcm::network::ULEvent::ULEvent
ULEvent(const EEventID &inEventID, std::vector< BasePDU * > inBasePDU, std::istream *iStream=nullptr, std::streampos posDataSet=0)
Definition gdcmULEvent.h:53
gdcm::network::ULEvent::GetPDUs
std::vector< BasePDU * > const & GetPDUs() const
Definition gdcmULEvent.h:70
gdcm::network::ULEvent::ULEvent
ULEvent(const EEventID &inEventID, BasePDU *inBasePDU, std::istream *iStream=nullptr, std::streampos posDataSet=0)
Definition gdcmULEvent.h:59
gdcm::network::ULEvent::GetDataSetPos
std::streampos GetDataSetPos() const
Definition gdcmULEvent.h:72
gdcm::network::ULEvent::SetPDU
void SetPDU(std::vector< BasePDU * > const &inPDU)
Definition gdcmULEvent.h:75
gdcm::network::ULEvent::~ULEvent
~ULEvent()
Definition gdcmULEvent.h:65
gdcmBasePDU.h
gdcmNetworkEvents.h
gdcmNetworkStateID.h
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm::network::EEventID
EEventID
Definition gdcmNetworkEvents.h:33
gdcm
Definition gdcmASN1.h:21