casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PartId.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 PartId.h
25  */
26 
27 #ifndef PartId_CLASS
28 #define PartId_CLASS
29 
30 #include <string>
31 
33 
34 #include <alma/ASDM/EndianStream.h>
35 
36 namespace asdm {
37 
44 class PartId {
45 
46 public:
47  static std::string validate(std::string x);
48 
49  PartId();
50  PartId(const PartId &);
51  PartId(const std::string &id) throw (InvalidArgumentException);
52  virtual ~PartId();
53 
54  bool equals(const PartId &) const;
55 
56  std::string toString() const;
57 
58  void setId(const std::string &s) throw (InvalidArgumentException);
59 
63  void toBin(EndianOSStream& eoss) const;
64 
72  static PartId fromBin(EndianIStream& eis);
73 private:
74  std::string id;
75 
76 };
77 
78 // PartId constructors
79 inline PartId::PartId() { }
80 
81 inline PartId::PartId(const PartId &x) : id(x.id) { }
82 
83 // PartId destructor
84 inline PartId::~PartId() { }
85 
86 inline bool PartId::equals(const PartId &x) const {
87  return id == x.id;
88 }
89 
90 inline std::string PartId::toString() const {
91  return id;
92 }
93 
94 } // End namespace asdm
95 
96 #endif /* PartId_CLASS */
static std::string validate(std::string x)
static PartId fromBin(EndianIStream &eis)
Read the binary representation of a PartId from a EndianIStream and use the read value to set an Part...
std::string id
Definition: PartId.h:74
void toBin(EndianOSStream &eoss) const
Write the binary representation of this to a EndianOSStream.
PartId()
PartId constructors.
Definition: PartId.h:79
description
Definition: PartId.h:44
bool equals(const PartId &) const
Definition: PartId.h:86
std::string toString() const
Definition: PartId.h:90
virtual ~PartId()
PartId destructor.
Definition: PartId.h:84
The InvalidArgumentException class represents an exception when an attempt is made to access somethin...
void setId(const std::string &s)