PTLib  Version 2.10.11
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  * $Revision: 21788 $
27  * $Author: rjongbloed $
28  * $Date: 2008-12-11 23:42:13 -0600 (Thu, 11 Dec 2008) $
29  */
30 
31 #ifndef PTLIB_GUID_H
32 #define PTLIB_GUID_H
33 
34 #ifdef P_USE_PRAGMA
35 #pragma interface
36 #endif
37 
38 class PASN_OctetString;
39 
40 
42 
49 {
50  PCLASSINFO(PGloballyUniqueID, PBYTEArray);
51 
52  public:
60 
67  const char * cstr
68  );
72  const PString & str
73  );
74 #if P_ASN
75 
78  const PASN_OctetString & ostr
79  );
80 #endif
81 
82 
89  virtual void PrintOn(
90  ostream & strm
91  ) const;
92 
97  virtual void ReadFrom(
98  istream & strm
99  );
100 
105  virtual PObject * Clone() const;
106 
111  virtual PINDEX HashFunction() const;
113 
118  PString AsString() const;
119 
122  PBoolean IsNULL() const;
123 
124  PBoolean operator!() const { return !IsNULL(); }
126 };
127 
128 
129 #endif // PTLIB_GUID_H
130 
131 
132 // End Of File ///////////////////////////////////////////////////////////////
PGloballyUniqueID()
Create a new ID.
virtual void PrintOn(ostream &strm) const
Standard stream print function.
virtual PObject * Clone() const
Create a clone of the ID.
virtual PINDEX HashFunction() const
Get the hash value for the ID.
PBoolean IsNULL() const
Test if the GUID is null, ie consists of all zeros.
BOOL PBoolean
Definition: object.h:102
Array of unsigned characters.
Definition: array.h:670
Globally unique ID definition.
Definition: guid.h:48
The character string class.
Definition: pstring.h:108
virtual void ReadFrom(istream &strm)
Standard stream read function.
PString AsString() const
Convert the ID to human readable string.
Class for ASN Octet String type.
Definition: asner.h:458
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PBoolean operator!() const
Definition: guid.h:124