ofxHTTP
A collection of tools for HTTP.
ofx::HTTP::AbstractSession Class Referenceabstract
Inheritance diagram for ofx::HTTP::AbstractSession:
ofx::HTTP::BaseSession ofx::HTTP::SimpleSession

Public Member Functions

virtual ~AbstractSession ()
 Destroy the AbstractSession.
 
virtual std::string getId () const =0
 Get the session id. More...
 
virtual bool has (const std::string &key) const =0
 Check to see if the provided key exists in the session data. More...
 
virtual void put (const std::string &key, const std::string &value)=0
 Add (or replace) a key in the sesion data with the given value. More...
 
virtual std::string get (const std::string &key, const std::string &defaultValue) const =0
 Get the session data for a given key, or a default value. More...
 
virtual std::string get (const std::string &key) const =0
 Get the session data for a given key, or throw an exception. More...
 
virtual void remove (const std::string &key)=0
 Remove a key / value pair. More...
 
virtual void clear ()=0
 Remove all data from the session.
 

Member Function Documentation

◆ get() [1/2]

virtual std::string ofx::HTTP::AbstractSession::get ( const std::string &  key,
const std::string &  defaultValue 
) const
pure virtual

Get the session data for a given key, or a default value.

Parameters
keyThe data key to get.
defaultValueThe data value to return if the key does not exist.
Returns
the data value for the key or the defaultValue if the key does not exist.

Implemented in ofx::HTTP::SimpleSession.

◆ get() [2/2]

virtual std::string ofx::HTTP::AbstractSession::get ( const std::string &  key) const
pure virtual

Get the session data for a given key, or throw an exception.

Parameters
keyThe data key to get.
Exceptions
Poco::InvalidAccessExceptionif key does not exist.
Returns
the data value for the key.

Implemented in ofx::HTTP::SimpleSession.

◆ getId()

virtual std::string ofx::HTTP::AbstractSession::getId ( ) const
pure virtual

Get the session id.

Returns
the session id.

Implemented in ofx::HTTP::BaseSession.

◆ has()

virtual bool ofx::HTTP::AbstractSession::has ( const std::string &  key) const
pure virtual

Check to see if the provided key exists in the session data.

Parameters
keyThe data key to check.
Returns
true iff the key exists in the session data.

Implemented in ofx::HTTP::SimpleSession.

◆ put()

virtual void ofx::HTTP::AbstractSession::put ( const std::string &  key,
const std::string &  value 
)
pure virtual

Add (or replace) a key in the sesion data with the given value.

Parameters
keyThe data key to add.
valueThe data value to add for the given key.

Implemented in ofx::HTTP::SimpleSession.

◆ remove()

virtual void ofx::HTTP::AbstractSession::remove ( const std::string &  key)
pure virtual

Remove a key / value pair.

Parameters
keyThe key to remove.

Implemented in ofx::HTTP::SimpleSession.


The documentation for this class was generated from the following file: