Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

mpcl::net::cgi::TSession< TCookie > Class Template Reference

CGI session tracker class. Uses generic cookies for session tracking. More...

#include <session.hh>

Inheritance diagram for mpcl::net::cgi::TSession< TCookie >:

List of all members.

Public Types

typedef TMap< TString, TString > TSubSubCookieValueMap
 Map for the subvalues of an structured cookie.


Public Methods

 TSession (void)
 Builds a new instance.

 TSession (const char *pkcSOURCE_STRING)
 TSession (const TString &rkySOURCE_STRING)
 TSession (std::basic_istream< char_type, traits_type > &rtSOURCE_ISTREAM)
void erase (const TString &rkyCOOKIE_NAME) throw (TVariableNotFoundException)
void erase (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR) throw (TVariableNotFoundException)
void erase (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR1, const TString &rkySUB_COOKIE_SELECTOR2) throw (TVariableNotFoundException)
void erase (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR1, const TString &rkySUB_COOKIE_SELECTOR2, const TString &rkySUB_COOKIE_NAME) throw (TVariableNotFoundException)
void keep (const TString &rkyCOOKIE_NAME, bool gKEEP=true)
void set (const TCookie &rktCOOKIE)
void set (const TString &rkyCOOKIE_NAME, const TString &rkyCOOKIE_VALUE)
void set (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR, const TSubSubCookieValueMap &rktSUB_COOKIE_VALUE_MAP)
void set (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR1, const TString &rkySUB_COOKIE_SELECTOR2, const TSubSubCookieValueMap &rktSUB_COOKIE_VALUE_MAP)
bool isEmpty (void) const
TString get (const TString &rkyCOOKIE_NAME) const throw (TVariableNotFoundException)
const TSubSubCookieValueMapget (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR) const throw (TVariableNotFoundException)
TSubSubCookieValueMapget (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR) throw (TVariableNotFoundException)
void get (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR, TSubSubCookieValueMap &rtSUB_COOKIE_VALUES) const throw (TVariableNotFoundException)
const TSubSubCookieValueMapget (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR1, const TString &rkySUB_COOKIE_SELECTOR2) const throw (TVariableNotFoundException)
TSubSubCookieValueMapget (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR1, const TString &rkySUB_COOKIE_SELECTOR2) throw (TVariableNotFoundException)
void get (const TString &rkyCOOKIE_NAME, const TString &rkySUB_COOKIE_SELECTOR1, const TString &rkySUB_COOKIE_SELECTOR2, TSubSubCookieValueMap &rtSUB_COOKIE_VALUES) const throw (TVariableNotFoundException)
bool has (const TString &rkyCOOKIE_NAME) const

Protected Methods

void read (std::basic_istream< char_type, traits_type > &rtSOURCE_ISTREAM)
void write (std::basic_ostream< char_type, traits_type > &rtTARGET_OSTREAM) const

Detailed Description

template<typename TCookie>
class mpcl::net::cgi::TSession< TCookie >

CGI session tracker class. Uses generic cookies for session tracking.

Definition at line 57 of file session.hh.


Constructor & Destructor Documentation

template<typename TCookie>
mpcl::net::cgi::TSession< TCookie >::TSession const char *    pkcSOURCE_STRING [inline]
 

Builds a new instance from a C-style string.

Parameters:
pkcSOURCE_STRING  String with cookies definitions.

Definition at line 219 of file session.hh.

References mpcl::net::cgi::TSession< TCookie >::read().

template<typename TCookie>
mpcl::net::cgi::TSession< TCookie >::TSession const TString &    rkySOURCE_STRING [inline]
 

Builds a new instance from a string.

Parameters:
rkySOURCE_STRING  String with cookies definitions.

Definition at line 235 of file session.hh.

References mpcl::net::cgi::TSession< TCookie >::read(), and mpcl::text::TString.

template<typename TCookie>
mpcl::net::cgi::TSession< TCookie >::TSession std::basic_istream< char_type, traits_type > &    rtSOURCE_ISTREAM [inline]
 

Builds a new instance from a stream.

Parameters:
rtSOURCE_ISTREAM  Source stream to read instance from.

Definition at line 251 of file session.hh.

References mpcl::net::cgi::TSession< TCookie >::read().


Member Function Documentation

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::erase const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR1,
const TString &    rkySUB_COOKIE_SELECTOR2,
const TString &    rkySUB_COOKIE_NAME
throw (TVariableNotFoundException)
 

Erases an structured sub-cookie from its name, its two selectors and its subname.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR1  Sub-cookie selector.
rkySUB_COOKIE_SELECTOR2  Sub-cookie selector.
rkySUB_COOKIE_NAME  Sub-cookie name.

Definition at line 688 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::erase const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR1,
const TString &    rkySUB_COOKIE_SELECTOR2
throw (TVariableNotFoundException)
 

Erases an structured sub-cookie from its name and its two selectors.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR1  Sub-cookie selector.
rkySUB_COOKIE_SELECTOR2  Sub-cookie selector.

Definition at line 651 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::erase const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR
throw (TVariableNotFoundException)
 

Erases an structured subcookie from its name and its selector.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR1  Sub-cookie selector.

Definition at line 624 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::erase const TString &    rkyCOOKIE_NAME throw (TVariableNotFoundException)
 

Erases a simple cookie from its name.

Parameters:
rkyCOOKIE_NAME  Cookie name.

Definition at line 594 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::get const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR1,
const TString &    rkySUB_COOKIE_SELECTOR2,
TSubSubCookieValueMap   rtSUB_COOKIE_VALUES
const throw (TVariableNotFoundException)
 

Gets a structured subcookie from its name and its two selectors.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR1  Sub-cookie selector.
rkySUB_COOKIE_SELECTOR2  Sub-cookie selector.
rtSUB_COOKIE_VALUES  Sub-cookie value map.

Definition at line 860 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
mpcl::net::cgi::TSession< TCookie >::TSubSubCookieValueMap & mpcl::net::cgi::TSession< TCookie >::get const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR1,
const TString &    rkySUB_COOKIE_SELECTOR2
throw (TVariableNotFoundException)
 

Gets a structured subcookie from its name and its two selectors.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR1  Sub-cookie selector.
rkySUB_COOKIE_SELECTOR2  Sub-cookie selector.
Returns:
A map with the subcookie values.

Definition at line 808 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
const mpcl::net::cgi::TSession< TCookie >::TSubSubCookieValueMap & mpcl::net::cgi::TSession< TCookie >::get const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR1,
const TString &    rkySUB_COOKIE_SELECTOR2
const throw (TVariableNotFoundException) [inline]
 

Gets a structured subcookie from its name and its two selectors.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR1  Sub-cookie selector.
rkySUB_COOKIE_SELECTOR2  Sub-cookie selector.
Returns:
A map with the subcookie values.

Definition at line 845 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::get const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR,
TSubSubCookieValueMap   rtSUB_COOKIE_VALUES
const throw (TVariableNotFoundException)
 

Gets a structured subcookie from its name and its selector.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR  Sub-cookie selector.
rtSUB_COOKIE_VALUES  Sub-cookie value map.

Definition at line 795 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
mpcl::net::cgi::TSession< TCookie >::TSubSubCookieValueMap & mpcl::net::cgi::TSession< TCookie >::get const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR
throw (TVariableNotFoundException)
 

Gets a structured subcookie from its name and its selector.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR  Sub-cookie selector.
Returns:
A writable map with the subcookie values.

Definition at line 768 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
const mpcl::net::cgi::TSession< TCookie >::TSubSubCookieValueMap & mpcl::net::cgi::TSession< TCookie >::get const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR
const throw (TVariableNotFoundException) [inline]
 

Gets a structured subcookie from its name and its selector.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR  Sub-cookie selector.
Returns:
A constant map with the subcookie values.

Definition at line 757 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
mpcl::text::TString mpcl::net::cgi::TSession< TCookie >::get const TString &    rkyCOOKIE_NAME const throw (TVariableNotFoundException)
 

Gets a simple cookie from its name.

Parameters:
rkyCOOKIE_NAME  Cookie name.
Returns:
The cookie value.

Definition at line 739 of file session.hh.

template<typename TCookie>
bool mpcl::net::cgi::TSession< TCookie >::has const TString &    rkyCOOKIE_NAME const [inline]
 

Returns true if there is a cookie named rkyCOOKIE_NAME.

Parameters:
rkyCOOKIE_NAME  Cookie name.
Returns:
True if cookie exists.

Definition at line 477 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
bool mpcl::net::cgi::TSession< TCookie >::isEmpty void    const [inline]
 

Returns true if there are no cookies.

Returns:
True if there are no cookiesw.

Definition at line 389 of file session.hh.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::keep const TString &    rkyCOOKIE_NAME,
bool    gKEEP = true
[inline]
 

Sets session transient status.

Parameters:
rkyCOOKIE_NAME  Cookie name.
gKEEP  True if cookie has to stand.

Definition at line 307 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::read std::basic_istream< char_type, traits_type > &    rtSOURCE_ISTREAM [protected]
 

Reads an instance from stream rtSOURCE_ISTREAM.

Parameters:
rtSOURCE_ISTREAM  Source input stream.

Definition at line 874 of file session.hh.

Referenced by mpcl::net::cgi::TSession< TCookie >::TSession().

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::set const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR1,
const TString &    rkySUB_COOKIE_SELECTOR2,
const TSubSubCookieValueMap   rktSUB_COOKIE_VALUE_MAP
 

Sets a cookie from a name, two cookie selectors and a map of values.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR1  Sub-cookie selector.
rkySUB_COOKIE_SELECTOR2  Sub-cookie selector.
rktSUB_COOKIE_VALUES_MAP  Sub-cookie values map.

Definition at line 1017 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::set const TString &    rkyCOOKIE_NAME,
const TString &    rkySUB_COOKIE_SELECTOR,
const TSubSubCookieValueMap   rktSUB_COOKIE_VALUE_MAP
 

Sets a cookie from a name, a cookie selector and a map of values.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkySUB_COOKIE_SELECTOR  Sub-cookie selector.
rktSUB_COOKIE_VALUES_MAP  Sub-cookie values map.

Definition at line 985 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::set const TString &    rkyCOOKIE_NAME,
const TString &    rkyCOOKIE_VALUE
[inline]
 

Sets a cookie from a name and a value.

Parameters:
rkyCOOKIE_NAME  Cookie name.
rkyCOOKIE_VALUE  Cookie value.

Definition at line 332 of file session.hh.

References mpcl::text::TString.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::set const TCookie   rktCOOKIE [inline]
 

Sets a cookie from a given one.

Parameters:
rktCOOKIE  Cookie to be set.

Definition at line 322 of file session.hh.

template<typename TCookie>
void mpcl::net::cgi::TSession< TCookie >::write std::basic_ostream< char_type, traits_type > &    rtTARGET_OSTREAM const [protected]
 

Writes the instance onto stream rtTARGET_OSTREAM.

Parameters:
rtTARGET_OSTREAM  Target output stream.

Definition at line 1081 of file session.hh.


The documentation for this class was generated from the following file:
Generated on Mon Oct 13 02:35:25 2003 for MPCL by doxygen1.2.18