sipxportlib  Version 3.3
UtlInt.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007-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 
15 #ifndef _UtlInt_h_
16 #define _UtlInt_h_
17 
18 // SYSTEM INCLUDES
19 // APPLICATION INCLUDES
20 #include <utl/UtlDefs.h>
22 #include <utl/UtlString.h>
23 
24 // DEFINES
25 // MACROS
26 // EXTERNAL FUNCTIONS
27 // EXTERNAL VARIABLES
28 // CONSTANTS
29 // STRUCTS
30 // TYPEDEFS
31 // FORWARD DECLARATIONS
32 
37 {
38 /* //////////////////////////// PUBLIC //////////////////////////////////// */
39 public:
40  static const UtlContainableType TYPE ;
42 /* ============================ CREATORS ================================== */
43 
47  UtlInt(int initialValue = 0) ;
48  UtlInt(const UtlInt& rhs) ;
49 
53  virtual ~UtlInt();
54 
56 
57 /* ============================ OPERATORS ============================== */
58 
59  // Declare prefix and postfix increment operators.
60  UtlInt& operator++(); // Prefix increment operator
61  UtlInt operator++(int); // Postfix increment operator
62 
63  // Declare prefix and postfix decrement operators.
64  UtlInt& operator--(); // Prefix decrement operator
65  UtlInt operator--(int); // Postfix decrement operator
66 
67  UtlInt& operator=(const UtlInt& rhs); // assigment operator
68 
69  // Conversion to int
70  operator int() { return mValue; }
71 
75  static void toString(UtlString& stringInt, int valueToStringify);
76 
77 /* ============================ MANIPULATORS ============================== */
78 
84  int setValue(int iValue) ;
85 
86 /* ============================ ACCESSORS ================================= */
87 
91  int getValue() const ;
92 
98  virtual unsigned hash() const ;
99 
103  virtual UtlContainableType getContainableType() const;
104 
105 /* ============================ INQUIRY =================================== */
106 
113  virtual int compareTo(UtlContainable const *) const ;
114 
119  virtual UtlBoolean isEqual(UtlContainable const *) const ;
120 
122  virtual UtlBoolean isInstanceOf(const UtlContainableType type) const;
123 
124 /* //////////////////////////// PROTECTED ///////////////////////////////// */
125 protected:
126 
127 /* //////////////////////////// PRIVATE /////////////////////////////////// */
128 private:
129  int mValue ;
131 } ;
132 
133 /* ============================ INLINE METHODS ============================ */
134 
135 #endif // _UtlInt_h_
UtlCopyableContainable * clone() const
Make an off the heap copy of this object.
Definition: UtlInt.cpp:48
static const UtlContainableType TYPE
Definition: UtlInt.h:40
virtual unsigned hash() const
Definition: UtlInt.cpp:117
Definition: UtlInt.h:36
UtlInt & operator++()
Definition: UtlInt.cpp:56
Definition: UtlCopyableContainable.h:43
virtual UtlContainableType getContainableType() const
Definition: UtlInt.cpp:123
virtual UtlBoolean isInstanceOf(const UtlContainableType type) const
Determine if this object is a derivative of the specified UtlContainableType.
Definition: UtlInt.cpp:154
int getValue() const
Definition: UtlInt.cpp:111
int setValue(int iValue)
Definition: UtlInt.cpp:101
UtlInt & operator--()
Definition: UtlInt.cpp:69
const char *const UtlContainableType
Definition: UtlDefs.h:70
virtual int compareTo(UtlContainable const *) const
Definition: UtlInt.cpp:130
Definition: UtlContainable.h:37
Definition: UtlString.h:48
virtual UtlBoolean isEqual(UtlContainable const *) const
Definition: UtlInt.cpp:149
static void toString(UtlString &stringInt, int valueToStringify)
Definition: UtlInt.cpp:92
UtlInt(int initialValue=0)
Definition: UtlInt.cpp:33
virtual ~UtlInt()
Definition: UtlInt.cpp:44
int UtlBoolean
Definition: UtlDefs.h:41
UtlInt & operator=(const UtlInt &rhs)
Definition: UtlInt.cpp:81