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

Public Member Functions

 BaseSession (const std::string sessionId=generateId())
 
std::string getId () const override
 Get the session id. More...
 
- Public Member Functions inherited from ofx::HTTP::AbstractSession
virtual ~AbstractSession ()
 Destroy the AbstractSession.
 
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.
 

Static Public Member Functions

static std::string generateId ()
 A utility function for generating unique session ids. More...
 

Static Public Attributes

static const std::string KEY_LAST_MODIFIED = "last_modified"
 

Protected Member Functions

 BaseSession (const BaseSession &)
 
BaseSessionoperator= (const BaseSession &)
 

Protected Attributes

std::string _sessionId
 
std::mutex _mutex
 

Member Function Documentation

◆ generateId()

std::string ofx::HTTP::BaseSession::generateId ( )
static

A utility function for generating unique session ids.

Returns
A unique session id string.

◆ getId()

std::string ofx::HTTP::BaseSession::getId ( ) const
overridevirtual

Get the session id.

Returns
the session id.

Implements ofx::HTTP::AbstractSession.


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