sipxportlib  Version 3.3
UtlContainable.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2011 SIPez LLC. All rights reserved.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2006 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 #ifndef _UtlContainable_h_
15 #define _UtlContainable_h_
16 
17 // SYSTEM INCLUDES
18 // APPLICATION INCLUDES
19 #include "utl/UtlDefs.h"
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 
38 {
39 /* //////////////////////////// PUBLIC //////////////////////////////////// */
40 public:
41 
42  static const UtlContainableType TYPE ;
44 /* ============================ CREATORS ================================== */
45 
49  virtual ~UtlContainable();
50 
54  virtual UtlContainableType getContainableType() const = 0 ;
55 
57  virtual unsigned hash() const = 0 ;
67  unsigned directHash() const;
98  static unsigned stringHash(char const* value);
109  virtual int compareTo(UtlContainable const *) const = 0 ;
130  virtual UtlBoolean isEqual(UtlContainable const *) const;
139  static UtlBoolean areSameTypes(const UtlContainableType type1, const UtlContainableType type2);
141 
143  virtual UtlBoolean isInstanceOf(const UtlContainableType type) const ;
167 /* //////////////////////////// PROTECTED ///////////////////////////////// */
168 protected:
169 
170 /* //////////////////////////// PRIVATE /////////////////////////////////// */
171 private:
172 
173 } ;
174 
175 /* ============================ INLINE METHODS ============================ */
176 
177 #endif // _UtlContainable_h_
virtual int compareTo(UtlContainable const *) const =0
Compare this object to another object.
unsigned directHash() const
Provides a hash function that uses the object pointer as the hash value.
Definition: UtlContainable.cpp:74
virtual UtlContainableType getContainableType() const =0
virtual UtlBoolean isInstanceOf(const UtlContainableType type) const
Determine if this object is a derivative of the specified UtlContainableType.
Definition: UtlContainable.cpp:59
virtual unsigned hash() const =0
Calculate a hash code for this object.
const char *const UtlContainableType
Definition: UtlDefs.h:70
Definition: UtlContainable.h:37
static unsigned stringHash(char const *value)
Provides a hash function appropriate for null-terminated string values.
Definition: UtlContainable.cpp:80
static const UtlContainableType TYPE
Definition: UtlContainable.h:42
static UtlBoolean areSameTypes(const UtlContainableType type1, const UtlContainableType type2)
Are UtlContainable types the same.
Definition: UtlContainable.cpp:52
virtual ~UtlContainable()
Definition: UtlContainable.cpp:38
virtual UtlBoolean isEqual(UtlContainable const *) const
Test this object to another object for equality.
Definition: UtlContainable.cpp:68
int UtlBoolean
Definition: UtlDefs.h:41