casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Entity.h
Go to the documentation of this file.
1 /*
2  * ALMA - Atacama Large Millimeter Array
3  * (c) European Southern Observatory, 2002
4  * (c) Associated Universities Inc., 2002
5  * Copyright by ESO (in the framework of the ALMA collaboration),
6  * Copyright by AUI (in the framework of the ALMA collaboration),
7  * All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY, without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22  * MA 02111-1307 USA
23  *
24  * File Entity.h
25  */
26 
27 #ifndef Entity_CLASS
28 #define Entity_CLASS
29 
30 #include <iostream>
31 #include <string>
32 
33 #ifndef WITHOUT_ACS
34 #include <asdmIDLTypesC.h>
35 #endif
36 
37 #include <alma/ASDM/EntityId.h>
38 
42 
43 #include <alma/ASDM/EndianStream.h>
44 
45 namespace asdm {
46 
47 class Entity;
48 std::ostream & operator << ( std::ostream &, const Entity & );
49 
59 class Entity {
60  friend std::ostream & operator << ( std::ostream &, const Entity & );
61  friend std::istream & operator >> ( std::istream &, Entity & );
62 
63 public:
64  static Entity getEntity(StringTokenizer &t);
65  Entity();
66  Entity(const std::string &s);
67 #ifndef WITHOUT_ACS
68  Entity(asdmIDLTypes::IDLEntity &);
69 #endif
70  Entity(std::string entityId, std::string entityIdEncrypted, std::string entityTypeName,
71  std::string entityVersion, std::string instanceVersion);
72  virtual ~Entity();
73 
74  bool operator == (const Entity &) const;
75  bool equals(const Entity &) const;
76  bool operator != (const Entity &) const;
77 
78  bool isNull() const;
79 
80  std::string toString() const;
81  std::string toXML() const;
82 #ifndef WITHOUT_ACS
83  asdmIDLTypes::IDLEntity toIDLEntity() const;
84 #endif
85  void setFromXML(std::string xml);
86 
90  void toBin(EndianOSStream& eoss) const ;
91 
98  static Entity fromBin(EndianIStream& eis);
99 
100 
101  EntityId getEntityId() const;
102  std::string getEntityIdEncrypted() const;
103  std::string getEntityTypeName() const;
104  std::string getEntityVersion() const;
105  std::string getInstanceVersion() const;
106  void setEntityId(EntityId e);
107  void setEntityIdEncrypted(std::string s);
108  void setEntityTypeName(std::string s);
109  void setEntityVersion(std::string s);
110  void setInstanceVersion(std::string s);
111 
112 private:
114  std::string entityIdEncrypted;
115  std::string entityTypeName;
116  std::string entityVersion;
117  std::string instanceVersion;
118 
119  std::string getXMLValue(std::string xml, std::string parm) const;
120  std::string validXML() const;
121 
122 };
123 
124 
125 
126 } // End namespace asdm
127 
128 #endif /* Entity_CLASS */
void setEntityId(EntityId e)
bool operator!=(const Entity &) const
std::string validXML() const
The StringTokenizer class is a translation into C++ of the Java class of the same name in Java&#39;s util...
void setEntityTypeName(std::string s)
asdmIDLTypes::IDLEntity toIDLEntity() const
std::string entityTypeName
Definition: Entity.h:115
std::string getEntityIdEncrypted() const
std::string entityIdEncrypted
Definition: Entity.h:114
void setFromXML(std::string xml)
std::string getEntityTypeName() const
std::string getInstanceVersion() const
friend std::ostream & operator<<(std::ostream &, const Entity &)
virtual ~Entity()
std::ostream & operator<<(std::ostream &, const EntityId &)
Friend functions.
Definition: EntityId.h:159
std::string toXML() const
bool equals(const Entity &) const
void setEntityVersion(std::string s)
friend std::istream & operator>>(std::istream &, Entity &)
const Double e
e and functions thereof:
EntityId getEntityId() const
std::string getXMLValue(std::string xml, std::string parm) const
static Entity getEntity(StringTokenizer &t)
void setEntityIdEncrypted(std::string s)
static Entity fromBin(EndianIStream &eis)
Read the binary representation of an Enity from a EndianIStream and use the read value to set an Enti...
bool isNull() const
std::string instanceVersion
Definition: Entity.h:117
void toBin(EndianOSStream &eoss) const
Write the binary representation of this to a EndianOSStream.
description
Definition: EntityId.h:56
EntityId entityId
Definition: Entity.h:113
std::string entityVersion
Definition: Entity.h:116
void setInstanceVersion(std::string s)
std::string toString() const
bool operator==(const Entity &) const
std::string getEntityVersion() const
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59