PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
guid.h
Go to the documentation of this file.
1 /*
2  * guid.h
3  *
4  * Globally Unique Identifier
5  *
6  * Open H323 Library
7  *
8  * Copyright (c) 1998-2001 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Open H323 Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Contributor(s): ______________________________________.
25  *
26  */
27 
28 #ifndef PTLIB_GUID_H
29 #define PTLIB_GUID_H
30 
31 #ifdef P_USE_PRAGMA
32 #pragma interface
33 #endif
34 
35 #include <ptlib_config.h>
36 
37 #if P_GUID
38 
39 class PASN_OctetString;
40 
41 
43 
49 class PGloballyUniqueID : public PBYTEArray
50 {
51  PCLASSINFO(PGloballyUniqueID, PBYTEArray);
52 
53  public:
54  enum {
56  Size = 16
57  };
58 
65  PGloballyUniqueID();
66 
72  PGloballyUniqueID(
73  const char * cstr
74  );
77  PGloballyUniqueID(
78  const PString & str
79  );
84  PGloballyUniqueID(
85  const void * data,
86  PINDEX size
87  );
88 #if P_ASN
89 
91  PGloballyUniqueID(
92  const PASN_OctetString & ostr
93  );
94 #endif
95 #ifdef GUID_DEFINED
96  PGloballyUniqueID(
97  const GUID & guid
98  );
99 #endif
100 
101 
108  virtual void PrintOn(
109  ostream & strm
110  ) const;
111 
116  virtual void ReadFrom(
117  istream & strm
118  );
119 
124  virtual PObject * Clone() const;
125 
130  virtual PINDEX HashFunction() const;
132 
137  PString AsString() const;
138 
141  PBoolean IsNULL() const;
142 
143  PBoolean operator!() const { return !IsNULL(); }
145 
146  private:
147  virtual PBoolean SetSize(PINDEX) { return true; }
148 };
149 
150 
151 #endif // P_GUID
152 
153 #endif // PTLIB_GUID_H
154 
155 // End Of File ///////////////////////////////////////////////////////////////
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:2164
virtual void ReadFrom(istream &strm)
Read the array.
virtual PObject * Clone() const
Clone the object.
Definition: array.h:641
Array of unsigned characters.
Definition: array.h:605
virtual PINDEX HashFunction() const
This function yields a hash value required by the PDictionary class.
bool PBoolean
Definition: object.h:174
The character string class.
Definition: pstring.h:108
virtual void PrintOn(ostream &strm) const
Print the array.
virtual PBoolean SetSize(PINDEX newSize)
Set the size of the array in elements.
Ultimate parent class for all objects in the class library.
Definition: object.h:2204