inlib  1.2.0
Public Member Functions | Protected Member Functions | Protected Attributes
inlib::plugin_cache Class Reference

List of all members.

Public Member Functions

virtual bool open (const std::string &a_name, plugin *&a_plugin)
 plugin_cache (std::ostream &a_out)
virtual ~plugin_cache ()
void clear ()

Protected Member Functions

 plugin_cache (const plugin_cache &a_from)
plugin_cacheoperator= (const plugin_cache &)

Protected Attributes

std::ostream & m_out
std::map< std::string, plugin * > m_cache

Detailed Description

Definition at line 216 of file plugin.


Constructor & Destructor Documentation

inlib::plugin_cache::plugin_cache ( std::ostream &  a_out) [inline]

Definition at line 235 of file plugin.

  :m_out(a_out)
  {}
virtual inlib::plugin_cache::~plugin_cache ( ) [inline, virtual]

Definition at line 238 of file plugin.

{clear();}
inlib::plugin_cache::plugin_cache ( const plugin_cache a_from) [inline, protected]

Definition at line 240 of file plugin.

  :m_out(a_from.m_out)
  {}

Member Function Documentation

void inlib::plugin_cache::clear ( ) [inline]

Definition at line 245 of file plugin.

               {
    std::map<std::string,plugin*>::iterator it;
    for(it = m_cache.begin();it!=m_cache.end();++it) {
      delete (*it).second;
    }
    m_cache.clear();
  }
virtual bool inlib::plugin_cache::open ( const std::string &  a_name,
plugin *&  a_plugin 
) [inline, virtual]

Definition at line 218 of file plugin.

                                                              {
    std::map<std::string,plugin*>::iterator it = m_cache.find(a_name);
    if(it!=m_cache.end()) { //a_name in the cache.
      a_plugin = (*it).second;
      return true;
    }
    a_plugin = new plugin(a_name,m_out);
    if(!a_plugin->is_opened()) {
      m_out << "inlib::can't open plugin " << a_name << std::endl;
      delete a_plugin;
      a_plugin = 0;
      return false;
    }
    m_cache[a_name] = a_plugin;
    return true;
  }
plugin_cache& inlib::plugin_cache::operator= ( const plugin_cache ) [inline, protected]

Definition at line 243 of file plugin.

{return *this;}

Member Data Documentation

std::map<std::string,plugin*> inlib::plugin_cache::m_cache [protected]

Definition at line 254 of file plugin.

std::ostream& inlib::plugin_cache::m_out [protected]

Definition at line 253 of file plugin.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines