CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OId.h
Go to the documentation of this file.
1 #ifndef INCLUDE_ORA_OID_H
2 #define INCLUDE_ORA_OID_H
3 
4 #include <string>
5 
6 namespace ora {
7 
8  class OId {
9 
10  public:
11  static bool isOId( const std::string& input );
12 
13  public:
14 
15  OId();
16 
17  explicit OId( const std::pair<int,int>& oidPair );
18 
19  OId( int contId, int itemId );
20 
21  OId( const OId& rhs );
22 
23  OId& operator=( const OId& rhs );
24 
25  bool operator==( const OId& rhs ) const;
26 
27  bool operator!=( const OId& rhs ) const;
28 
29  int containerId() const;
30 
31  int itemId() const;
32 
33  bool fromString( const std::string& s );
34 
35  std::string toString() const;
36 
37  void toOutputStream( std::ostream& os ) const;
38 
39  void reset();
40 
41  bool isInvalid() const;
42 
43  std::pair<int,int> toPair() const;
44 
45  private:
47  int m_itemId;
48  };
49 
50  class ITokenParser {
51  public:
52  virtual ~ITokenParser(){
53  }
54 
55  virtual OId parse( const std::string& poolToken ) = 0;
56  virtual std::string className( const std::string& poolToken ) = 0;
57  };
58 
59  class ITokenWriter {
60  public:
61  virtual ~ITokenWriter(){
62  }
63 
64  virtual std::string write( const OId& oid ) = 0;
65  };
66 
67 }
68 
69 inline std::ostream& operator << (std::ostream& os, const ora::OId& oid ){
70  oid.toOutputStream(os);
71  return os;
72 }
73 
74 #endif
75 
76 
virtual std::string write(const OId &oid)=0
virtual std::string className(const std::string &poolToken)=0
bool isInvalid() const
Definition: OId.cc:80
Definition: OId.h:8
int m_containerId
Definition: OId.h:46
static bool isOId(const std::string &input)
Definition: OId.cc:9
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
OId()
Definition: OId.cc:14
bool operator==(const OId &rhs) const
Definition: OId.cc:40
std::pair< int, int > toPair() const
Definition: OId.cc:84
OId & operator=(const OId &rhs)
Definition: OId.cc:34
int containerId() const
Definition: OId.cc:50
bool operator!=(const OId &rhs) const
Definition: OId.cc:46
virtual ~ITokenWriter()
Definition: OId.h:61
int m_itemId
Definition: OId.h:47
virtual ~ITokenParser()
Definition: OId.h:52
virtual OId parse(const std::string &poolToken)=0
std::string toString() const
Definition: OId.cc:58
void reset()
Definition: OId.cc:75
bool fromString(const std::string &s)
Definition: OId.cc:64
void toOutputStream(std::ostream &os) const
Definition: OId.cc:71
int itemId() const
Definition: OId.cc:54