Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Static Public Attributes | Protected Attributes | Private Attributes
Arc::BrokerLoader Class Reference

Class responsible for loading Broker plugins The Broker objects returned by a BrokerLoader must not be used after the BrokerLoader goes out of scope. More...

#include <Broker.h>

Inheritance diagram for Arc::BrokerLoader:
Inheritance graph
[legend]
Collaboration diagram for Arc::BrokerLoader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BrokerLoader ()
 Constructor Creates a new BrokerLoader.
 ~BrokerLoader ()
 Destructor Calling the destructor destroys all Brokers loaded by the BrokerLoader instance.
Brokerload (const std::string &name, const UserConfig &usercfg)
 Load a new Broker.
const std::list< Broker * > & GetBrokers () const
 Retrieve the list of loaded Brokers.

Static Public Attributes

static Logger logger

Protected Attributes

PluginsFactoryfactory_
 Link to Factory responsible for loading and creation of Plugin and derived objects.

Private Attributes

std::list< Broker * > brokers

Detailed Description

Class responsible for loading Broker plugins The Broker objects returned by a BrokerLoader must not be used after the BrokerLoader goes out of scope.

Definition at line 84 of file Broker.h.


Constructor & Destructor Documentation

Constructor Creates a new BrokerLoader.

Definition at line 430 of file Broker.cpp.

    : Loader(BaseConfig().MakeConfig(Config()).Parent()) {}

Destructor Calling the destructor destroys all Brokers loaded by the BrokerLoader instance.

Definition at line 433 of file Broker.cpp.

                              {
    for (std::list<Broker*>::iterator it = brokers.begin();
         it != brokers.end(); it++)
      delete *it;
  }

Member Function Documentation

const std::list<Broker*>& Arc::BrokerLoader::GetBrokers ( ) const [inline]

Retrieve the list of loaded Brokers.

Returns:
A reference to the list of Brokers.

Definition at line 106 of file Broker.h.

                                               {
      return brokers;
    }

Here is the caller graph for this function:

Broker * Arc::BrokerLoader::load ( const std::string &  name,
const UserConfig usercfg 
)

Load a new Broker.

Parameters:
nameThe name of the Broker to load.
usercfgThe UserConfig object for the new Broker.
Returns:
A pointer to the new Broker (NULL on error).

Definition at line 439 of file Broker.cpp.

                                                        {
    if (name.empty())
      return NULL;

    if(!factory_->load(FinderLoader::GetLibrariesList(),
                       "HED:Broker", name)) {
      logger.msg(ERROR, "Broker plugin \"%s\" not found.", name);
      return NULL;
    }

    BrokerPluginArgument arg(usercfg);
    Broker *broker = factory_->GetInstance<Broker>("HED:Broker", name, &arg, false);

    if (!broker) {
      logger.msg(ERROR, "Broker %s could not be created", name);
      return NULL;
    }

    brokers.push_back(broker);
    logger.msg(INFO, "Loaded Broker %s", name);
    return broker;
  }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

std::list<Broker*> Arc::BrokerLoader::brokers [private]

Definition at line 111 of file Broker.h.

PluginsFactory* Arc::Loader::factory_ [protected, inherited]

Link to Factory responsible for loading and creation of Plugin and derived objects.

Definition at line 23 of file Loader.h.

Logger Arc::Loader::logger [static, inherited]

Definition at line 18 of file Loader.h.


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