LLService Class Reference

This class is the base class for the service classes. More...

#include <llservice.h>

Inheritance diagram for LLService:

Inheritance graph
[legend]
Collaboration diagram for LLService:

Collaboration graph
[legend]
List of all members.

Public Types

typedef boost::shared_ptr<
LLChainIOFactory
creator_t

Static Public Member Functions

static bool registerCreator (const std::string &name, creator_t fn)
 This method is used to register a protocol name with a a functor that creates the service.
static LLIOPipeactivate (const std::string &name, LLPumpIO::chain_t &chain, LLSD context)
 This method connects to a service by name.
static bool discard (const std::string &name)

Protected Types

typedef std::map< std::string,
creator_t
creators_t

Protected Member Functions

 LLService ()
virtual ~LLService ()

Protected Attributes

LLIOPipe::ptr_t mResponse

Static Protected Attributes

static creators_t sCreatorFunctors

Detailed Description

This class is the base class for the service classes.

See also:
LLIOPipe
The services map a string to a chain factory with a known interface at the front of the chain. So, to activate a service, call activate() with the name of the service needed which will call the associated factory, and return a pointer to the known interface. NOTE: If you are implementing a service factory, it is vitally important that the service pipe is at the front of the chain.

Definition at line 119 of file llservice.h.


Member Typedef Documentation

typedef boost::shared_ptr<LLChainIOFactory> LLService::creator_t

Definition at line 124 of file llservice.h.

typedef std::map<std::string, creator_t> LLService::creators_t [protected]

Definition at line 159 of file llservice.h.


Constructor & Destructor Documentation

LLService::LLService (  )  [protected]

Definition at line 38 of file llservice.cpp.

LLService::~LLService (  )  [protected, virtual]

Definition at line 42 of file llservice.cpp.


Member Function Documentation

LLIOPipe * LLService::activate ( const std::string &  name,
LLPumpIO::chain_t chain,
LLSD  context 
) [static]

This method connects to a service by name.

Parameters:
name The name of the service to connect to.
chain The constructed chain including the service instance.
context Context for the activation.
Returns:
An instance of the service for use or NULL on failure.

Definition at line 65 of file llservice.cpp.

References llendl, llinfos, llwarns, NULL, and sCreatorFunctors.

bool LLService::discard ( const std::string &  name  )  [static]

Parameters:
name The name of the service to discard.
Returns:
true if service creator was found and discarded.

Definition at line 101 of file llservice.cpp.

References sCreatorFunctors.

bool LLService::registerCreator ( const std::string &  name,
creator_t  fn 
) [static]

This method is used to register a protocol name with a a functor that creates the service.

THOROUGH_DESCRIPTION

Parameters:
aParameter A brief description of aParameter.
Returns:
Returns true if a service was successfully registered.

Definition at line 47 of file llservice.cpp.

References llendl, llinfos, and sCreatorFunctors.


Member Data Documentation

LLIOPipe::ptr_t LLService::mResponse [protected]

Definition at line 186 of file llservice.h.

LLService::creators_t LLService::sCreatorFunctors [static, protected]

Definition at line 160 of file llservice.h.

Referenced by activate(), discard(), and registerCreator().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:46 2010 for Second Life Viewer by  doxygen 1.4.7