License Class Reference

#include <License.h>

Inherits Object, and Singleton< T >< License >.

Inheritance diagram for License:

Inheritance graph
[legend]
Collaboration diagram for License:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int check (const String &license)
int check ()
int checkWithMsg ()
String mac () const
time_t expirationTime () const
int generate (const String &mac, const time_t expirationTime, String &license)

Private Member Functions

 License ()
virtual ~License ()
int mac (String &mac)
int encode (char *encodedData, const char *data, const unsigned int size)
int decode (char *dencodedData, const char *data, const unsigned int size)
unsigned char crc (const char *data, const unsigned int size)

Private Attributes

time_t _expirationTime
String _mac

Friends

class Singleton< License >

Detailed Description

Definition at line 42 of file License.h.


Constructor & Destructor Documentation

License::License (  )  [private]

Definition at line 146 of file License.cpp.

References _expirationTime.

License::~License (  )  [private, virtual]

Definition at line 151 of file License.cpp.


Member Function Documentation

int License::check ( const String license  ) 

Definition at line 25 of file License.cpp.

References _expirationTime, _mac, crc(), CSTRING(), decode(), ERROR, ERROR_BACKTRACE(), FAILED(), LICENSE_LIMIT_SIZE, LICENSE_MAC_ADDRESS_SIZE, LICENSE_MAGIC_TIME, MSG_LICENSE_INVALID, OK, and SWAP32_IF_BE.

int License::check (  ) 

Definition at line 50 of file License.cpp.

References CSTRING(), decode(), ERROR, ERROR_BACKTRACE(), FAILED(), LICENSE_FILE_PATH, LICENSE_LIMIT_SIZE, LICENSE_MAC_ADDRESS_SIZE, LICENSE_MAGIC_MAC, mac(), MSG_FILE_CANNOT_CLOSE, MSG_FILE_CANNOT_OPEN, MSG_LICENSE_INVALID, and OK.

Referenced by checkWithMsg().

int License::checkWithMsg (  ) 

Definition at line 84 of file License.cpp.

References check(), ERROR_BACKTRACE(), FAILED(), LICENSE_MSG, LICENSE_MSG_DELAY, and OK.

String License::mac (  )  const

Definition at line 96 of file License.cpp.

References _mac.

Referenced by check(), generate(), and mac().

time_t License::expirationTime (  )  const

Definition at line 101 of file License.cpp.

References _expirationTime.

int License::generate ( const String mac,
const time_t  expirationTime,
String license 
)

Definition at line 106 of file License.cpp.

References crc(), CSTRING(), encode(), ERROR_BACKTRACE(), FAILED(), LICENSE_LIMIT_SIZE, LICENSE_MAC_ADDRESS_SIZE, LICENSE_MAGIC_TIME, mac(), OK, and SWAP32_IF_BE.

int License::mac ( String mac  )  [private]

Definition at line 155 of file License.cpp.

References ERROR, LICENSE_IF_NAME, mac(), MSG_SOCKET_CANNOT_CLOSE, MSG_SOCKET_CANNOT_CREATE, MSG_SOCKET_CANNOT_GET_INFO, and OK.

int License::encode ( char *  encodedData,
const char *  data,
const unsigned int  size 
) [private]

Definition at line 179 of file License.cpp.

References DEBUG, OK, and SWAP32_IF_BE.

Referenced by generate().

int License::decode ( char *  dencodedData,
const char *  data,
const unsigned int  size 
) [private]

Definition at line 210 of file License.cpp.

References ERROR, MSG_LICENSE_INVALID, OK, and SWAP32_IF_BE.

Referenced by check().

unsigned char License::crc ( const char *  data,
const unsigned int  size 
) [private]

Definition at line 241 of file License.cpp.

Referenced by check(), and generate().


Friends And Related Function Documentation

friend class Singleton< License > [friend]

Definition at line 46 of file License.h.


Member Data Documentation

time_t License::_expirationTime [private]

Definition at line 75 of file License.h.

Referenced by check(), expirationTime(), and License().

String License::_mac [private]

Definition at line 76 of file License.h.

Referenced by check(), and mac().


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 20:13:43 2007 for Pylon Application Platform by  doxygen 1.5.1