PionNetworkLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pion::plugin_ptr< InterfaceClassType > Class Template Reference

#include <plugin.hpp>

Inheritance diagram for pion::plugin_ptr< InterfaceClassType >:
Collaboration diagram for pion::plugin_ptr< InterfaceClassType >:

Public Member Functions

 plugin_ptr (void)
 default constructor & destructor More...
 
virtual ~plugin_ptr ()
 
 plugin_ptr (const plugin_ptr &p)
 copy constructor More...
 
plugin_ptroperator= (const plugin_ptr &p)
 assignment operator More...
 
InterfaceClassType * create (void)
 creates a new instance of the plug-in object More...
 
void destroy (InterfaceClassType *object_ptr)
 destroys an instance of the plug-in object More...
 
- Public Member Functions inherited from pion::plugin
virtual ~plugin ()
 
bool is_open (void) const
 returns true if a shared library is loaded/open More...
 
std::string get_plugin_name (void) const
 returns the name of the plugin that is currently open More...
 
void open (const std::string &plugin_name)
 
void open_file (const std::string &plugin_file)
 
void close (void)
 closes plug-in library More...
 

Protected Types

typedef InterfaceClassType * CreateObjectFunction (void)
 data type for a function that is used to create object instances More...
 
typedef void DestroyObjectFunction (InterfaceClassType *)
 data type for a function that is used to destroy object instances More...
 

Additional Inherited Members

- Static Public Member Functions inherited from pion::plugin
static bool find_plugin_file (std::string &path_to_file, const std::string &name)
 
static bool find_config_file (std::string &path_to_file, const std::string &name)
 
static void add_static_entry_point (const std::string &plugin_name, void *create_func, void *destroy_func)
 
static void check_cygwin_path (boost::filesystem::path &final_path, const std::string &path_string)
 
static void add_plugin_directory (const std::string &dir)
 appends a directory to the plug-in search path More...
 
static void reset_plugin_directories (void)
 clears all directories from the plug-in search path More...
 
static void get_all_plugin_names (std::vector< std::string > &plugin_names)
 returns a list of all Plugins found in all Plugin directories More...
 
- Protected Member Functions inherited from pion::plugin
 plugin (void)
 default constructor is private (use plugin_ptr class to create objects) More...
 
 plugin (const plugin &p)
 copy constructor More...
 
pluginoperator= (const plugin &p)
 assignment operator More...
 
void * get_create_function (void)
 returns a pointer to the plug-in's "create object" function More...
 
void * get_destroy_function (void)
 returns a pointer to the plug-in's "destroy object" function More...
 
void release_data (void)
 releases the plug-in's shared library symbols More...
 
void grab_data (const plugin &p)
 grabs a reference to another plug-in's shared library symbols More...
 

Detailed Description

template<typename InterfaceClassType>
class pion::plugin_ptr< InterfaceClassType >

plugin_ptr: smart pointer that manages plug-in code loaded from shared object libraries

Member Typedef Documentation

template<typename InterfaceClassType>
typedef InterfaceClassType* pion::plugin_ptr< InterfaceClassType >::CreateObjectFunction(void)
protected

data type for a function that is used to create object instances

template<typename InterfaceClassType>
typedef void pion::plugin_ptr< InterfaceClassType >::DestroyObjectFunction(InterfaceClassType *)
protected

data type for a function that is used to destroy object instances

Constructor & Destructor Documentation

template<typename InterfaceClassType>
pion::plugin_ptr< InterfaceClassType >::plugin_ptr ( void  )
inline

default constructor & destructor

template<typename InterfaceClassType>
virtual pion::plugin_ptr< InterfaceClassType >::~plugin_ptr ( )
inlinevirtual
template<typename InterfaceClassType>
pion::plugin_ptr< InterfaceClassType >::plugin_ptr ( const plugin_ptr< InterfaceClassType > &  p)
inline

copy constructor

Member Function Documentation

template<typename InterfaceClassType>
InterfaceClassType* pion::plugin_ptr< InterfaceClassType >::create ( void  )
inline

creates a new instance of the plug-in object

References pion::plugin::get_create_function().

Referenced by pion::plugin_manager< PluginType >::load().

template<typename InterfaceClassType>
void pion::plugin_ptr< InterfaceClassType >::destroy ( InterfaceClassType *  object_ptr)
inline

destroys an instance of the plug-in object

References pion::plugin::get_destroy_function().

template<typename InterfaceClassType>
plugin_ptr& pion::plugin_ptr< InterfaceClassType >::operator= ( const plugin_ptr< InterfaceClassType > &  p)
inline

assignment operator

References pion::plugin::grab_data().


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