1 #include "SUIT_DataObjectKey.h"
7 #define _typeinfo std::type_info
10 #define _typeinfo type_info
13 /*!\class SUIT_DataObjectKey
14 * Key for personal idetfication of SUIT_DataObject.
20 SUIT_DataObjectKey::SUIT_DataObjectKey()
28 SUIT_DataObjectKey::~SUIT_DataObjectKey()
32 /*!\class SUIT_DataObjectKeyHandle
33 * Wrapper around the pointer of class SUIT_DataObjectKey.
39 SUIT_DataObjectKeyHandle::SUIT_DataObjectKeyHandle()
47 SUIT_DataObjectKeyHandle::SUIT_DataObjectKeyHandle( const SUIT_DataObjectKeyHandle& other )
48 : myKey( other.myKey )
56 Constructor. Initialize by key \a key.
58 SUIT_DataObjectKeyHandle::SUIT_DataObjectKeyHandle( SUIT_DataObjectKey* key )
67 SUIT_DataObjectKeyHandle::~SUIT_DataObjectKeyHandle()
73 * Checks: Is key null?
74 *\retval TRUE - if null, esle false.
76 bool SUIT_DataObjectKeyHandle::isNull() const
84 void SUIT_DataObjectKeyHandle::nullify()
91 *\retval boolean. TRUE - If current key less than \a kw.
93 bool SUIT_DataObjectKeyHandle::operator<( const SUIT_DataObjectKeyHandle& kw ) const
95 if ( myKey == kw.myKey )
98 if ( !myKey || !kw.myKey )
99 return myKey < kw.myKey;
101 const _typeinfo& i1 = typeid( *myKey );
102 const _typeinfo& i2 = typeid( *kw.myKey );
104 int cmp = strcmp( i1.name(), i2.name() );
110 return myKey->isLess( kw.myKey );
115 *\retval boolean. TRUE - If current key equal \a kw.
117 bool SUIT_DataObjectKeyHandle::operator==( const SUIT_DataObjectKeyHandle& kw ) const
119 if ( myKey == kw.myKey )
122 if ( !myKey || !kw.myKey )
125 if ( typeid( *myKey ) != typeid( *kw.myKey ) )
128 return myKey->isEqual( kw.myKey );
132 * Copy value of key \a kw to current.
134 SUIT_DataObjectKeyHandle& SUIT_DataObjectKeyHandle::operator=( const SUIT_DataObjectKeyHandle& kw )
136 if ( myKey != kw.myKey )
148 * Inctrement reference counter for current key.
150 void SUIT_DataObjectKeyHandle::beginScope()
157 * Decrement reference counter for current key.
159 void SUIT_DataObjectKeyHandle::endScope()
166 if ( !myKey->refCounter )