version 1.1.2.4, 2007/01/09 02:41:17
|
version 1.1.2.5, 2007/01/09 22:36:25
|
|
|
#define _Pegasus_Common_SessionKey_h | #define _Pegasus_Common_SessionKey_h |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
|
#include <Pegasus/Common/String.h> |
#include "Linkage.h" | #include "Linkage.h" |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
|
char _data[SESSION_KEY_LENGTH+1]; | char _data[SESSION_KEY_LENGTH+1]; |
}; | }; |
| |
|
/** The SessionKeyMap maintains a mapping between userNames and sessionKeys |
|
It provides methods for adding, finding, and removing userName-sessionKey |
|
pairs. |
|
*/ |
|
class PEGASUS_COMMON_LINKAGE SessionKeyMap |
|
{ |
|
public: |
|
|
|
SessionKeyMap(); |
|
|
|
SessionKeyMap(const SessionKeyMap& x); |
|
|
|
~SessionKeyMap(); |
|
|
|
void clear(); |
|
|
|
SessionKeyMap& operator=(const SessionKeyMap& x); |
|
|
|
bool insert(const String& userName, const SessionKey& sessionKey); |
|
|
|
bool find(const String& userName, SessionKey& sessionKey); |
|
|
|
bool remove(const String& userName); |
|
|
|
private: |
|
|
|
void _copy(const SessionKeyMap& x); |
|
|
|
struct Pair |
|
{ |
|
const String userName; |
|
SessionKey sessionKey; |
|
|
|
Pair(const String& u, const SessionKey& s) : userName(u), sessionKey(s) |
|
{ |
|
} |
|
}; |
|
|
|
Pair* _data; |
|
Uint32 _size; |
|
}; |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
#endif /* _Pegasus_Common_SessionKey_h */ | #endif /* _Pegasus_Common_SessionKey_h */ |