Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef Entity_CLASS
00028 #define Entity_CLASS
00029
00030 #include <iostream>
00031 #include <string>
00032 using namespace std;
00033
00034 #ifndef WITHOUT_ACS
00035 #include <asdmIDLTypesC.h>
00036 using asdmIDLTypes::IDLEntity;
00037 #endif
00038
00039 #include <EntityId.h>
00040
00041 #include <StringTokenizer.h>
00042 #include <InvalidArgumentException.h>
00043 #include <InvalidDataException.h>
00044 using asdm::StringTokenizer;
00045 using asdm::InvalidArgumentException;
00046 using asdm::InvalidDataException;
00047
00048 #include "EndianStream.h"
00049 using asdm::EndianOSStream;
00050 using asdm::EndianISStream;
00051
00052 namespace asdm {
00053
00054 class Entity;
00055 ostream & operator << ( ostream &, const Entity & );
00056
00065 class Entity {
00066 friend ostream & operator << ( ostream &, const Entity & );
00067 friend istream & operator >> ( istream &, Entity&);
00068
00069 public:
00070 static Entity getEntity(StringTokenizer &t) throw(InvalidArgumentException);
00071
00072 Entity();
00073 Entity(const string &s);
00074 #ifndef WITHOUT_ACS
00075 Entity(IDLEntity &);
00076 #endif
00077 Entity(string entityId, string entityIdEncrypted, string entityTypeName,
00078 string entityVersion, string instanceVersion);
00079 virtual ~Entity();
00080
00081 bool operator == (const Entity &) const;
00082 bool equals(const Entity &) const;
00083 bool operator != (const Entity &) const;
00084
00085 bool isNull() const;
00086
00087 string toString() const;
00088 string toXML() const throw(InvalidDataException);
00089 #ifndef WITHOUT_ACS
00090 IDLEntity toIDLEntity() const;
00091 #endif
00092 void setFromXML(string xml) throw(InvalidArgumentException);
00093
00097 void toBin(EndianOSStream& eoss);
00098
00105 static Entity fromBin(EndianISStream& eiss);
00106
00107 EntityId getEntityId() const;
00108 string getEntityIdEncrypted() const;
00109 string getEntityTypeName() const;
00110 string getEntityVersion() const;
00111 string getInstanceVersion() const;
00112 void setEntityId(EntityId e);
00113 void setEntityIdEncrypted(string s);
00114 void setEntityTypeName(string s);
00115 void setEntityVersion(string s);
00116 void setInstanceVersion(string s);
00117
00118 private:
00119 EntityId entityId;
00120 string entityIdEncrypted;
00121 string entityTypeName;
00122 string entityVersion;
00123 string instanceVersion;
00124
00125 string getXMLValue(string xml, string parm) const;
00126 string validXML() const;
00127
00128 };
00129
00130
00131
00132 }
00133
00134 #endif