MeVisLabToolboxReference
|
00001 //---------------------------------------------------------------------------------- 00002 // **InsertLicense** code 00003 //---------------------------------------------------------------------------------- 00005 00010 //---------------------------------------------------------------------------------- 00011 00012 #ifndef CLASS_DCMTREE_MESSAGE 00013 #define CLASS_DCMTREE_MESSAGE 00014 00015 #include <string> 00016 00017 #include <istream> 00018 #include <ostream> 00019 00020 #include "DCMTree_Lib.h" 00021 #include "DCMTree_Tree.h" 00022 00023 #include "DCMTree_Defines.h" 00024 00025 #include "DCMTree_Serialization.h" 00026 00027 #ifdef _MSC_VER 00028 #pragma warning (push) 00029 #pragma warning (disable : 4251) 00030 #endif 00031 00032 namespace DCMTree 00033 { 00039 class DCMTREE_EXPORT Message:public DCMTree_Serialization::Serializable,public DCMTree_Serialization::Deserializable 00040 { 00041 public: 00045 Message(); 00046 00048 Message (const Message &other); 00049 00051 Message (const std::string &specificCharacterSet,TransferSyntax syntax); 00052 00054 virtual ~Message(); 00055 00059 void convertToCharacterSet (const std::string &characterset); 00060 00064 Message &operator=(const Message &other); 00065 00069 std::string specificCharacterSet(); 00070 00074 std::string specifiedCharacterSet(); 00075 00079 TransferSyntax syntax() const; 00080 00084 const TreePtr &tags(); 00085 00089 const Const_TreePtr &tags() const; 00090 00094 void setTags (TreePtr tags); 00095 00099 void setTags (Const_TreePtr tags); 00100 00107 void fromStream (std::istream &in, bool readName); 00108 00115 void toStream (std::ostream &out, bool writeName) const; 00116 00117 void serializeX (DCMTree_Serialization::Sink &sink) const; 00118 void deserializeX (DCMTree_Serialization::Source &source); 00119 00120 private: 00121 std::string _specificcharacterset; 00122 TransferSyntax _syntax; 00123 TreePtr _tags; 00124 Const_TreePtr _constTags; 00125 }; 00126 00127 inline std::ostream &operator << (std::ostream &out,const Message &m) 00128 { 00129 m.toStream (out, false); 00130 return out; 00131 } 00132 00133 inline std::istream &operator >> (std::istream &in,Message &m) 00134 { 00135 m.fromStream (in, false); 00136 return in; 00137 } 00138 } 00139 00140 #ifdef _MSC_VER 00141 #pragma warning (pop) 00142 #endif 00143 00144 #endif 00145 00146