utils::InterfaceTable Class Reference

The InterfaceTable contains a list of interfaces. From this class caller can add and query a given interface. More...

#include <interfaces_utils.h>

Collaboration diagram for utils::InterfaceTable:
Collaboration graph
[legend]

Public Member Functions

 InterfaceTable ()
 ~InterfaceTable ()
template<class T >
void add_entry (T *ptr)
bool query_interface (const char *name, void **return_ptr)
template<class T >
bool contain_interface (T *ptr)
 InterfaceTable ()
 ~InterfaceTable ()
template<class T >
void add_entry (T *ptr)
bool query_interface (const char *name, void **return_ptr)
template<class T >
bool contain_interface (T *ptr)
 InterfaceTable ()
 ~InterfaceTable ()
template<class T >
void add_entry (T *ptr)
bool query_interface (const char *name, void **return_ptr)
template<class T >
bool contain_interface (T *ptr)

Detailed Description

The InterfaceTable contains a list of interfaces. From this class caller can add and query a given interface.

Definition at line 102 of file images/plugin_impl/interfaces_utils.h.


Constructor & Destructor Documentation

utils::InterfaceTable::InterfaceTable (  )  [inline]

Definition at line 105 of file images/plugin_impl/interfaces_utils.h.

00106     {
00107     }

utils::InterfaceTable::~InterfaceTable (  )  [inline]

Definition at line 109 of file images/plugin_impl/interfaces_utils.h.

00110     {
00111         clear();
00112     }

utils::InterfaceTable::InterfaceTable (  )  [inline]

Definition at line 105 of file pdf/plugin_impl/interfaces_utils.h.

00106     {
00107     }

utils::InterfaceTable::~InterfaceTable (  )  [inline]

Definition at line 109 of file pdf/plugin_impl/interfaces_utils.h.

00110     {
00111         clear();
00112     }

utils::InterfaceTable::InterfaceTable (  )  [inline]

Definition at line 105 of file plaintext/plugin_impl/interfaces_utils.h.

00106     {
00107     }

utils::InterfaceTable::~InterfaceTable (  )  [inline]

Definition at line 109 of file plaintext/plugin_impl/interfaces_utils.h.

00110     {
00111         clear();
00112     }


Member Function Documentation

template<class T >
void utils::InterfaceTable::add_entry ( T *  ptr  )  [inline]

Definition at line 116 of file plaintext/plugin_impl/interfaces_utils.h.

References ERRORPRINTF, utils::MAX_INTERFACES, and name.

00117     {
00118         interfaces.push_back(new InterfaceEntry<T>(ptr));
00119         unsigned int size = interfaces.size();
00120         if (size > MAX_INTERFACES)
00121         {
00122             ERRORPRINTF("Too many interfaces for class %s: interfaces.size [%u] max [%u]",
00123                         typeid(T).name(), size, MAX_INTERFACES);
00124         }
00125     }

template<class T >
void utils::InterfaceTable::add_entry ( T *  ptr  )  [inline]

Definition at line 116 of file pdf/plugin_impl/interfaces_utils.h.

References ERRORPRINTF, utils::MAX_INTERFACES, and name.

00117     {
00118         interfaces.push_back(new InterfaceEntry<T>(ptr));
00119         unsigned int size = interfaces.size();
00120         if (size > MAX_INTERFACES)
00121         {
00122             ERRORPRINTF("Too many interfaces for class %s: interfaces.size [%u] max [%u]",
00123                         typeid(T).name(), size, MAX_INTERFACES);
00124         }
00125     }

template<class T >
void utils::InterfaceTable::add_entry ( T *  ptr  )  [inline]

Definition at line 116 of file images/plugin_impl/interfaces_utils.h.

References ERRORPRINTF, utils::MAX_INTERFACES, and name.

Referenced by utils::ObjectTable< PluginRenderResultImpl >::add_interface().

00117     {
00118         interfaces.push_back(new InterfaceEntry<T>(ptr));
00119         unsigned int size = interfaces.size();
00120         if (size > MAX_INTERFACES)
00121         {
00122             ERRORPRINTF("Too many interfaces for class %s: interfaces.size [%u] max [%u]",
00123                         typeid(T).name(), size, MAX_INTERFACES);
00124         }
00125     }

Here is the caller graph for this function:

template<class T >
bool utils::InterfaceTable::contain_interface ( T *  ptr  )  [inline]

Definition at line 145 of file plaintext/plugin_impl/interfaces_utils.h.

00146     {
00147         Iter begin = interfaces.begin();
00148         Iter end   = interfaces.end();
00149         for(Iter it = begin; it != end; ++it)
00150         {
00151             if (ptr == (*it)->get_pointer())
00152             {
00153                 return true;
00154             }
00155         }
00156         return false;
00157     }

template<class T >
bool utils::InterfaceTable::contain_interface ( T *  ptr  )  [inline]

Definition at line 145 of file pdf/plugin_impl/interfaces_utils.h.

00146     {
00147         Iter begin = interfaces.begin();
00148         Iter end   = interfaces.end();
00149         for(Iter it = begin; it != end; ++it)
00150         {
00151             if (ptr == (*it)->get_pointer())
00152             {
00153                 return true;
00154             }
00155         }
00156         return false;
00157     }

template<class T >
bool utils::InterfaceTable::contain_interface ( T *  ptr  )  [inline]

Definition at line 145 of file images/plugin_impl/interfaces_utils.h.

00146     {
00147         Iter begin = interfaces.begin();
00148         Iter end   = interfaces.end();
00149         for(Iter it = begin; it != end; ++it)
00150         {
00151             if (ptr == (*it)->get_pointer())
00152             {
00153                 return true;
00154             }
00155         }
00156         return false;
00157     }

bool utils::InterfaceTable::query_interface ( const char *  name,
void **  return_ptr 
) [inline]

Definition at line 127 of file plaintext/plugin_impl/interfaces_utils.h.

00128     {
00129         Iter begin = interfaces.begin();
00130         Iter end   = interfaces.end();
00131         for(Iter it = begin; it != end; ++it)
00132         {
00133             if ((*it)->is_name_equal(name))
00134             {
00135                 *return_ptr = (*it)->get_pointer();
00136                 return true;
00137             }
00138         }
00139         // This could happen when caller wants to query a optional
00140         // interface. Should not use assert here.
00141         return false;
00142     }

bool utils::InterfaceTable::query_interface ( const char *  name,
void **  return_ptr 
) [inline]

Definition at line 127 of file pdf/plugin_impl/interfaces_utils.h.

00128     {
00129         Iter begin = interfaces.begin();
00130         Iter end   = interfaces.end();
00131         for(Iter it = begin; it != end; ++it)
00132         {
00133             if ((*it)->is_name_equal(name))
00134             {
00135                 *return_ptr = (*it)->get_pointer();
00136                 return true;
00137             }
00138         }
00139         // This could happen when caller wants to query a optional
00140         // interface. Should not use assert here.
00141         return false;
00142     }

bool utils::InterfaceTable::query_interface ( const char *  name,
void **  return_ptr 
) [inline]

Definition at line 127 of file images/plugin_impl/interfaces_utils.h.

00128     {
00129         Iter begin = interfaces.begin();
00130         Iter end   = interfaces.end();
00131         for(Iter it = begin; it != end; ++it)
00132         {
00133             if ((*it)->is_name_equal(name))
00134             {
00135                 *return_ptr = (*it)->get_pointer();
00136                 return true;
00137             }
00138         }
00139         // This could happen when caller wants to query a optional
00140         // interface. Should not use assert here.
00141         return false;
00142     }


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208