Cat
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
DLL Class Reference

#include <inc/DLL.h>

Public Types

typedef void * ImageHandle
 
typedef void(* EntryPoint) (DLL *)
 
typedef Element *(* ConstructorElement) ()
 
typedef void(* DestructorElement) (Element *)
 
typedef Processus *(* ConstructorProcessus) ()
 
typedef void(* DestructorProcessus) (Processus *)
 
typedef Object *(* ConstructorObject) ()
 
typedef void(* DestructorObject) (Object *)
 
typedef std::pair< std::string, std::string > identification
 
typedef std::vector< identificationlistOfElements
 
typedef std::vector< identificationlistOfProcessus
 
typedef std::vector< identificationlistOfObjects
 

Public Member Functions

 DLL ()
 Standard constructor. More...
 
virtual ~DLL ()
 Destructor. More...
 
StatusCode load (std::string)
 
StatusCode unload ()
 
void setName (std::string name)
 
std::string name ()
 
listOfElements listElements ()
 
listOfProcessus listProcessus ()
 
listOfObjects listObjects ()
 
void addElement (std::string element, std::string description=std::string(""))
 
void addProcessus (std::string proc, std::string description=std::string(""))
 
void addObject (std::string proc, std::string description=std::string(""))
 
bool containsObject (std::string)
 
std::vector< std::string > objectList ()
 
StatusCode init ()
 
ElementcreateElement (std::string)
 
ProcessuscreateProcessus (std::string)
 
ObjectcreateObject (std::string)
 
StatusCode destroy (Element *)
 
StatusCode destroy (Processus *)
 
StatusCode destroy (Object *)
 
void print ()
 

Private Member Functions

void msg (std::string mymsg)
 
void verbose (std::string mymsg)
 
void debug (std::string mymsg)
 
void info (std::string mymsg)
 
void warning (std::string mymsg)
 
void fatal (std::string mymsg)
 
void msg (std::string mymsg, std::string name)
 
void verbose (std::string mymsg, std::string name)
 
void debug (std::string mymsg, std::string name)
 
void info (std::string mymsg, std::string name)
 
void warning (std::string mymsg, std::string name)
 
void fatal (std::string mymsg, std::string name)
 

Private Attributes

MsgSvc m_log
 
std::string m_name
 
ImageHandle m_handle
 
listOfElements m_listElements
 
listOfProcessus m_listProcessus
 
listOfObjects m_listObjects
 
std::vector< ConstructorElementm_elementConstructors
 
std::vector< DestructorElementm_elementDestructors
 
std::vector< ConstructorProcessusm_processusConstructors
 
std::vector< DestructorProcessusm_processusDestructors
 
std::vector< ConstructorObjectm_objectConstructors
 
std::vector< DestructorObjectm_objectDestructors
 

Detailed Description

Author
Date
2006-10-24

Definition at line 57 of file DLL.h.

Member Typedef Documentation

◆ ConstructorElement

typedef Element*(* DLL::ConstructorElement) ()

Definition at line 69 of file DLL.h.

◆ ConstructorObject

typedef Object*(* DLL::ConstructorObject) ()

Definition at line 73 of file DLL.h.

◆ ConstructorProcessus

typedef Processus*(* DLL::ConstructorProcessus) ()

Definition at line 71 of file DLL.h.

◆ DestructorElement

typedef void(* DLL::DestructorElement) (Element *)

Definition at line 70 of file DLL.h.

◆ DestructorObject

typedef void(* DLL::DestructorObject) (Object *)

Definition at line 74 of file DLL.h.

◆ DestructorProcessus

typedef void(* DLL::DestructorProcessus) (Processus *)

Definition at line 72 of file DLL.h.

◆ EntryPoint

typedef void(* DLL::EntryPoint) (DLL *)

Definition at line 67 of file DLL.h.

◆ identification

typedef std::pair<std::string,std::string> DLL::identification

Definition at line 76 of file DLL.h.

◆ ImageHandle

typedef void* DLL::ImageHandle

Definition at line 64 of file DLL.h.

◆ listOfElements

typedef std::vector<identification> DLL::listOfElements

Definition at line 77 of file DLL.h.

◆ listOfObjects

typedef std::vector<identification> DLL::listOfObjects

Definition at line 79 of file DLL.h.

◆ listOfProcessus

typedef std::vector<identification> DLL::listOfProcessus

Definition at line 78 of file DLL.h.

Constructor & Destructor Documentation

◆ DLL()

DLL::DLL ( )

Standard constructor.

Definition at line 20 of file DLL.cpp.

20  :
21 m_handle (0)
22 {
23 }
ImageHandle m_handle
Definition: DLL.h:221

◆ ~DLL()

DLL::~DLL ( )
virtual

Destructor.

Definition at line 27 of file DLL.cpp.

27 {}

Member Function Documentation

◆ addElement()

void DLL::addElement ( std::string  element,
std::string  description = std::string ("") 
)
inline

Append an Element to the DLL

Definition at line 139 of file DLL.h.

References m_listElements.

141  {
142  identification id ( element , description );
143  m_listElements.push_back( id );
144  }
listOfElements m_listElements
Definition: DLL.h:222
std::pair< std::string, std::string > identification
Definition: DLL.h:76

◆ addObject()

void DLL::addObject ( std::string  proc,
std::string  description = std::string ("") 
)
inline

Append a Object to the DLL

Definition at line 159 of file DLL.h.

References containsObject(), createElement(), createObject(), createProcessus(), destroy(), init(), m_listObjects, objectList(), and print().

161  {
162  identification id ( proc , description );
163  m_listObjects.push_back( id );
164  }
std::pair< std::string, std::string > identification
Definition: DLL.h:76
listOfObjects m_listObjects
Definition: DLL.h:224
Definition: proc.py:1

◆ addProcessus()

void DLL::addProcessus ( std::string  proc,
std::string  description = std::string ("") 
)
inline

Append a Processus to the DLL

Definition at line 149 of file DLL.h.

References m_listProcessus.

151  {
152  identification id ( proc , description );
153  m_listProcessus.push_back( id );
154  }
listOfProcessus m_listProcessus
Definition: DLL.h:223
std::pair< std::string, std::string > identification
Definition: DLL.h:76
Definition: proc.py:1

◆ containsObject()

bool DLL::containsObject ( std::string  name)

find if Object belong to the library

Definition at line 32 of file DLL.cpp.

References m_listElements, and m_listProcessus.

Referenced by addObject().

32  {
33  std::vector<identification>::const_iterator iter;
34  for ( iter=m_listElements.begin() ;
35  iter!=m_listElements.end() ;
36  ++iter ) {
37  if ( 0==name.compare( iter->first ) ){
38  return true;
39  }
40  }
41  for ( iter=m_listProcessus.begin() ;
42  iter!=m_listProcessus.end() ;
43  ++iter ) {
44  if ( 0==name.compare( iter->first ) ){
45  return true;
46  }
47  }
48  return false;
49 }
listOfElements m_listElements
Definition: DLL.h:222
listOfProcessus m_listProcessus
Definition: DLL.h:223
std::string name()
Definition: DLL.h:108

◆ createElement()

Element * DLL::createElement ( std::string  name)

Create an Element from its type

Definition at line 278 of file DLL.cpp.

References m_elementConstructors, m_listElements, name(), and Object::setDllName().

Referenced by addObject(), and DLLMgr::createElement().

278  {
279  std::vector<identification>::const_iterator iter;
280  std::vector<ConstructorElement>::const_iterator constructor=m_elementConstructors.begin();
281  for ( iter=m_listElements.begin() ;
282  iter!=m_listElements.end() ;
283  ++iter ) {
284  if ( 0==name.compare(iter->first) ){
285  Element *element = (*constructor)() ;
286  element->setDllName(this->name());
287  return ( element );
288  }
289  constructor++;
290  }
291  return NULL;
292 }
void setDllName(std::string dllName)
Definition: Object.h:66
listOfElements m_listElements
Definition: DLL.h:222
std::vector< ConstructorElement > m_elementConstructors
Definition: DLL.h:225
std::string name()
Definition: DLL.h:108

◆ createObject()

Object* DLL::createObject ( std::string  )

Create a Object from its type

Referenced by addObject().

◆ createProcessus()

Processus * DLL::createProcessus ( std::string  name)

Create a Processus from its type

Definition at line 297 of file DLL.cpp.

References m_listProcessus, m_processusConstructors, name(), and Object::setDllName().

Referenced by addObject(), DLLMgr::createProcessus(), and init().

297  {
298  std::vector<identification>::const_iterator iter;
299  std::vector<ConstructorProcessus>::const_iterator constructor=m_processusConstructors.begin();
300  for ( iter=m_listProcessus.begin() ;
301  iter!=m_listProcessus.end() ;
302  ++iter ) {
303  if ( 0==name.compare(iter->first) ){
304  Processus *processus=(*constructor)();
305  processus->setDllName(this->name());
306  return ( processus );
307  }
308  constructor++;
309  }
310  return NULL;
311 }
void setDllName(std::string dllName)
Definition: Object.h:66
listOfProcessus m_listProcessus
Definition: DLL.h:223
std::string name()
Definition: DLL.h:108
std::vector< ConstructorProcessus > m_processusConstructors
Definition: DLL.h:227

◆ debug() [1/2]

void DLL::debug ( std::string  mymsg)
inlineprivate

Definition at line 234 of file DLL.h.

References MsgSvc::DEBUG, and MsgSvc::msgSvc().

Referenced by load().

234 { m_log.msgSvc (MsgSvc::DEBUG , mymsg, m_name ); }
std::string m_name
Definition: DLL.h:220
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ debug() [2/2]

void DLL::debug ( std::string  mymsg,
std::string  name 
)
inlineprivate

Definition at line 241 of file DLL.h.

References MsgSvc::DEBUG, and MsgSvc::msgSvc().

241 { m_log.msgSvc (MsgSvc::DEBUG , mymsg, name ); }
std::string name()
Definition: DLL.h:108
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ destroy() [1/3]

StatusCode DLL::destroy ( Element ptr)

Destroy an Element from its pointer

Definition at line 316 of file DLL.cpp.

References StatusCode::FAILURE, m_elementDestructors, m_listElements, StatusCode::SUCCESS, and Object::type().

Referenced by addObject(), and DLLMgr::destroy().

316  {
317  std::vector<identification>::const_iterator iter;
318  std::vector<DestructorElement>::const_iterator destructor=m_elementDestructors.begin();
319  for ( iter=m_listElements.begin() ;
320  iter!=m_listElements.end() ;
321  ++iter ) {
322  if ( 0==(ptr->type()).compare(iter->first) ){
323  ( (*destructor)( ptr ) );
324  return StatusCode::SUCCESS;
325  }
326  destructor++;
327  }
328  return StatusCode::FAILURE;
329 }
listOfElements m_listElements
Definition: DLL.h:222
std::vector< DestructorElement > m_elementDestructors
Definition: DLL.h:226
std::string type()
Definition: Object.h:29

◆ destroy() [2/3]

StatusCode DLL::destroy ( Processus ptr)

Destroy a Processus from its pointer

Definition at line 334 of file DLL.cpp.

References StatusCode::FAILURE, m_listProcessus, m_processusDestructors, StatusCode::SUCCESS, and Object::type().

334  {
335  std::vector<identification>::const_iterator iter;
336  std::vector<DestructorProcessus>::const_iterator destructor=m_processusDestructors.begin();
337  for ( iter=m_listProcessus.begin() ;
338  iter!=m_listProcessus.end() ;
339  ++iter ) {
340  if ( 0==(ptr->type()).compare(iter->first) ){
341  ( (*destructor)( ptr ) );
342  return StatusCode::SUCCESS;
343  }
344  destructor++;
345  }
346  return StatusCode::FAILURE;
347 }
listOfProcessus m_listProcessus
Definition: DLL.h:223
std::vector< DestructorProcessus > m_processusDestructors
Definition: DLL.h:228
std::string type()
Definition: Object.h:29

◆ destroy() [3/3]

StatusCode DLL::destroy ( Object )

Destroy a Object from its pointer

◆ fatal() [1/2]

void DLL::fatal ( std::string  mymsg)
inlineprivate

Definition at line 237 of file DLL.h.

References MsgSvc::FATAL, and MsgSvc::msgSvc().

237 { m_log.msgSvc (MsgSvc::FATAL , mymsg, m_name ); }
std::string m_name
Definition: DLL.h:220
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ fatal() [2/2]

void DLL::fatal ( std::string  mymsg,
std::string  name 
)
inlineprivate

Definition at line 244 of file DLL.h.

References MsgSvc::FATAL, and MsgSvc::msgSvc().

244 { m_log.msgSvc (MsgSvc::FATAL , mymsg, name ); }
std::string name()
Definition: DLL.h:108
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ info() [1/2]

void DLL::info ( std::string  mymsg)
inlineprivate

Definition at line 235 of file DLL.h.

References MsgSvc::INFO, and MsgSvc::msgSvc().

Referenced by load(), and print().

235 { m_log.msgSvc (MsgSvc::INFO , mymsg, m_name ); }
std::string m_name
Definition: DLL.h:220
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ info() [2/2]

void DLL::info ( std::string  mymsg,
std::string  name 
)
inlineprivate

Definition at line 242 of file DLL.h.

References MsgSvc::INFO, and MsgSvc::msgSvc().

242 { m_log.msgSvc (MsgSvc::INFO , mymsg, name ); }
std::string name()
Definition: DLL.h:108
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ init()

StatusCode DLL::init ( )

initialization of the dll

Definition at line 172 of file DLL.cpp.

References ProcDataBase::add(), application(), createProcessus(), StatusCode::FAILURE, m_elementConstructors, m_elementDestructors, m_handle, m_listElements, m_listProcessus, m_processusConstructors, m_processusDestructors, Application::procDb(), StatusCode::SUCCESS, and warning().

Referenced by addObject(), and load().

172  {
173  bool initOk = true;
174  std::vector<identification>::const_iterator iter;
175  for ( iter=m_listElements.begin() ;
176  iter!=m_listElements.end() ;
177  ++iter ) {
178  ConstructorElement constructor;
179  DestructorElement destructor;
180 #ifdef WIN32
181  constructor = (ConstructorElement)GetProcAddress(m_handle,
182  (iter->first+
183  std::string("_create")).c_str());
184  destructor = (DestructorElement)GetProcAddress(m_handle,
185  (iter->first+
186  std::string("_destroy")).c_str());
187 #else
188  constructor = (ConstructorElement)dlsym(m_handle,
189  (iter->first+
190  std::string("_create")).c_str());
191  destructor = (DestructorElement)dlsym(m_handle,
192  (iter->first+
193  std::string("_destroy")).c_str());
194 #endif
195  if ( 0 == constructor) {
196  warning("Could not find constructor of "+iter->first+std::string(" (_create)"),"DLL::init");
197  initOk=false;
198  }
199  if ( 0 == destructor) {
200  warning("Could not find destructor of "+iter->first+std::string(" (_destroy)"),"DLL::init");
201  initOk=false;
202  }
203  if (initOk) {
204  m_elementConstructors.push_back( constructor );
205  m_elementDestructors.push_back( destructor );
206  }
207  }
208  if (!initOk){
209  return StatusCode::FAILURE;
210  }
211 
212  initOk=true;
213  for ( iter=m_listProcessus.begin() ;
214  iter!=m_listProcessus.end() ;
215  ++iter ) {
216  ConstructorProcessus constructor;
217  DestructorProcessus destructor;
218 #ifdef WIN32
219  constructor = (ConstructorProcessus)GetProcAddress(m_handle,
220  (iter->first+
221  std::string("_create")).c_str());
222  destructor = (DestructorProcessus)GetProcAddress(m_handle,
223  (iter->first+
224  std::string("_destroy")).c_str());
225 #else
226  constructor = (ConstructorProcessus)dlsym(m_handle,
227  (iter->first+
228  std::string("_create")).c_str());
229  destructor = (DestructorProcessus)dlsym(m_handle,
230  (iter->first+
231  std::string("_destroy")).c_str());
232 #endif
233  if ( 0 == constructor) {
234  warning("Could not find constructor of "+iter->first,"DLL::init");
235  initOk=false;
236  }
237  if ( 0 == destructor) {
238  warning("Could not find destructor of "+iter->first,"DLL::init");
239  initOk=false;
240  }
241  if (initOk){
242  m_processusConstructors.push_back( constructor );
243  m_processusDestructors.push_back( destructor );
244  // create the corresponding processus in the database
245  Processus* proc = createProcessus ( iter->first );
246  if ( 0==proc ){
247  initOk=false;
248  }
249  else {
250  application()->procDb()->add( proc);
251  }
252  }
253  }
254  if (!initOk){
255  return StatusCode::FAILURE;
256  }
257  return StatusCode::SUCCESS;
258 }
listOfElements m_listElements
Definition: DLL.h:222
listOfProcessus m_listProcessus
Definition: DLL.h:223
std::vector< ConstructorElement > m_elementConstructors
Definition: DLL.h:225
std::vector< DestructorProcessus > m_processusDestructors
Definition: DLL.h:228
std::vector< DestructorElement > m_elementDestructors
Definition: DLL.h:226
std::vector< ConstructorProcessus > m_processusConstructors
Definition: DLL.h:227
Processus *(* ConstructorProcessus)()
Definition: DLL.h:71
StatusCode add(Processus *)
Application * application()
Definition: Tools.cpp:42
Processus * createProcessus(std::string)
Definition: DLL.cpp:297
Element *(* ConstructorElement)()
Definition: DLL.h:69
void warning(std::string mymsg)
Definition: DLL.h:236
ProcDataBase * procDb()
Definition: Application.h:111
void(* DestructorProcessus)(Processus *)
Definition: DLL.h:72
Definition: proc.py:1
void(* DestructorElement)(Element *)
Definition: DLL.h:70
ImageHandle m_handle
Definition: DLL.h:221

◆ listElements()

listOfElements DLL::listElements ( )
inline

Get accessor to member m_listElement

Returns
the current value of m_listElement

Definition at line 116 of file DLL.h.

References m_listElements.

116  {
117  return m_listElements;
118  }
listOfElements m_listElements
Definition: DLL.h:222

◆ listObjects()

listOfObjects DLL::listObjects ( )
inline

Get accessor to member m_listObjects

Returns
the current value of m_listObjects

Definition at line 132 of file DLL.h.

References m_listObjects.

132  {
133  return m_listObjects;
134  }
listOfObjects m_listObjects
Definition: DLL.h:224

◆ listProcessus()

listOfProcessus DLL::listProcessus ( )
inline

Get accessor to member m_listProcessus

Returns
the current value of m_listProcessus

Definition at line 124 of file DLL.h.

References m_listProcessus.

124  {
125  return m_listProcessus;
126  }
listOfProcessus m_listProcessus
Definition: DLL.h:223

◆ load()

StatusCode DLL::load ( std::string  library)

Load the library according to its name

Definition at line 118 of file DLL.cpp.

References debug(), StatusCode::FAILURE, info(), init(), m_handle, name(), print(), setName(), StatusCode::SUCCESS, and warning().

Referenced by DLLMgr::load().

118  {
119  typedef Element* (*func) ();
120 #ifdef WIN32
121  m_handle = LoadLibrary ((library+std::string(".dll")).c_str());
122 #else
123  m_handle = dlopen( (std::string("lib")+library+std::string(".so")).c_str() , RTLD_LAZY );
124 #endif
125  if ( NULL != m_handle ) {
126 
127  // get entry point
128  setName(library);
129  DLL::EntryPoint entryPoint;
130 #ifdef WIN32
131  entryPoint = (DLL::EntryPoint)GetProcAddress(m_handle,
132  (library+std::string("_dll")).c_str());
133 #else
134  entryPoint = (DLL::EntryPoint)dlsym(m_handle,
135  (library+std::string("_dll")).c_str());
136 #endif
137  if ( !entryPoint ) {
138  warning("No entry point found in library "+library+".","DLL::load");
139  // could not find entry point
140 #ifdef WIN32
141  FreeLibrary( m_handle );
142 #else
143  dlclose( m_handle );
144 #endif
145  warning("Could not load dll entry point "+name(),"DLL::load");
146  return StatusCode::FAILURE;
147  }
148  else {
149  debug("Entry point found in library "+library+".","DLL::load");
150  // entry point found : load list of objects
151  entryPoint ( this );
152  // check if we can find constructors/destructors
153  if ( init().isFailure() ) {
154  info("Could not find Constructors/Destructors in library "+
155  library+".","DLL::load");
156  return StatusCode::FAILURE;
157  }
158  print();
159  return StatusCode::SUCCESS;
160  }
161  }
162  else {
163  warning("No handle on library "+library+".","DLL::load");
164  }
165  return StatusCode::FAILURE;
166 }
StatusCode init()
Definition: DLL.cpp:172
std::string name()
Definition: DLL.h:108
void info(std::string mymsg)
Definition: DLL.h:235
void(* EntryPoint)(DLL *)
Definition: DLL.h:67
void print()
Definition: DLL.cpp:74
void warning(std::string mymsg)
Definition: DLL.h:236
void debug(std::string mymsg)
Definition: DLL.h:234
void setName(std::string name)
Definition: DLL.h:100
ImageHandle m_handle
Definition: DLL.h:221

◆ msg() [1/2]

void DLL::msg ( std::string  mymsg)
inlineprivate

Definition at line 232 of file DLL.h.

References MsgSvc::msgSvc(), and MsgSvc::NONE.

232 { m_log.msgSvc (MsgSvc::NONE , mymsg, m_name ); }
std::string m_name
Definition: DLL.h:220
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ msg() [2/2]

void DLL::msg ( std::string  mymsg,
std::string  name 
)
inlineprivate

Definition at line 239 of file DLL.h.

References MsgSvc::msgSvc(), and MsgSvc::NONE.

239 { m_log.msgSvc (MsgSvc::NONE , mymsg, name ); }
std::string name()
Definition: DLL.h:108
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ name()

std::string DLL::name ( )
inline

Get accessor to member m_name

Returns
the current value of m_name

Definition at line 108 of file DLL.h.

References m_name.

Referenced by createElement(), createProcessus(), load(), print(), and setName().

108  {
109  return m_name;
110  }
std::string m_name
Definition: DLL.h:220

◆ objectList()

std::vector< std::string > DLL::objectList ( )

list of Objects

Definition at line 55 of file DLL.cpp.

References m_listElements, and m_listProcessus.

Referenced by addObject(), and DLLMgr::load().

55  {
56  std::vector<std::string> list;
57  std::vector<identification>::const_iterator iter;
58  for ( iter=m_listElements.begin() ;
59  iter!=m_listElements.end() ;
60  ++iter ) {
61  list.push_back ( iter->first );
62  }
63  for ( iter=m_listProcessus.begin() ;
64  iter!=m_listProcessus.end() ;
65  ++iter ) {
66  list.push_back ( iter->first );
67  }
68  return list;
69 }
listOfElements m_listElements
Definition: DLL.h:222
listOfProcessus m_listProcessus
Definition: DLL.h:223

◆ print()

void DLL::print ( )

print DLL information

Definition at line 74 of file DLL.cpp.

References application(), info(), itos(), m_listElements, m_listProcessus, name(), Application::procDb(), ProcDataBase::processus(), and Object::type().

Referenced by addObject(), export_base(), and load().

74  {
75  char line [100];
76  info("Symbols found in dll "+name()+": "+
77  itos(m_listElements.size())+" Element(s) - "+
78  itos(m_listProcessus.size())+" Processus.");
79  std::vector<identification>::const_iterator iter;
80  if ( m_listElements.size()>0 ) {
81  sprintf(line,"============================================================================================");
82  info(line,"DLL::print");
83  sprintf(line ,"Element Description");
84  info(line,"DLL::print");
85  for ( iter=m_listElements.begin() ;
86  iter!=m_listElements.end() ;
87  ++iter ) {
88  sprintf(line," %25s %65s ",
89  iter->first.c_str(),
90  iter->second.c_str());
91  info(std::string(line),"DLL::print");
92  }
93  }
94  if ( m_listProcessus.size() > 0 ) {
95  sprintf(line,"============================================================================================");
96  info(line,"DLL::print");
97  sprintf (line ,"Processus Target Type");
98  info(line,"DLL::print");
99  for ( iter=m_listProcessus.begin() ;
100  iter!=m_listProcessus.end() ;
101  ++iter ) {
102  sprintf(line," %25s %25s ",
103  iter->first.c_str(),
104  application()->procDb()->processus(iter->first)->type().c_str()
105  // application()->procDb()->processus(iter->first)->title().c_str()
106  );
107  info(std::string(line),"DLL::print");
108  }
109  }
110  sprintf(line,"============================================================================================");
111  info(line,"DLL::print");
112 }
std::string itos(int)
Definition: Tools.cpp:46
listOfElements m_listElements
Definition: DLL.h:222
listOfProcessus m_listProcessus
Definition: DLL.h:223
std::string name()
Definition: DLL.h:108
void info(std::string mymsg)
Definition: DLL.h:235
Application * application()
Definition: Tools.cpp:42
ProcDataBase * procDb()
Definition: Application.h:111
Processus * processus(std::string)
std::string type()
Definition: Object.h:29

◆ setName()

void DLL::setName ( std::string  name)
inline

Set accessor to member m_name

Parameters
namethe new value for m_name

Definition at line 100 of file DLL.h.

References m_name, and name().

Referenced by load().

100  {
101  m_name = name;
102  }
std::string name()
Definition: DLL.h:108
std::string m_name
Definition: DLL.h:220

◆ unload()

StatusCode DLL::unload ( )

Unload the library

Definition at line 263 of file DLL.cpp.

References StatusCode::FAILURE, m_handle, and StatusCode::SUCCESS.

263  {
264  if ( NULL != m_handle ){
265 #ifdef WIN32
266  FreeLibrary( m_handle );
267 #else
268  dlclose( m_handle );
269 #endif
270  return StatusCode::SUCCESS;
271  }
272  return StatusCode::FAILURE;
273 }
ImageHandle m_handle
Definition: DLL.h:221

◆ verbose() [1/2]

void DLL::verbose ( std::string  mymsg)
inlineprivate

Definition at line 233 of file DLL.h.

References MsgSvc::msgSvc(), and MsgSvc::VERBOSE.

233 { m_log.msgSvc (MsgSvc::VERBOSE , mymsg, m_name ); }
std::string m_name
Definition: DLL.h:220
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ verbose() [2/2]

void DLL::verbose ( std::string  mymsg,
std::string  name 
)
inlineprivate

Definition at line 240 of file DLL.h.

References MsgSvc::msgSvc(), and MsgSvc::VERBOSE.

240 { m_log.msgSvc (MsgSvc::VERBOSE , mymsg, name ); }
std::string name()
Definition: DLL.h:108
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ warning() [1/2]

void DLL::warning ( std::string  mymsg)
inlineprivate

Definition at line 236 of file DLL.h.

References MsgSvc::msgSvc(), and MsgSvc::WARNING.

Referenced by init(), and load().

236 { m_log.msgSvc (MsgSvc::WARNING , mymsg, m_name ); }
std::string m_name
Definition: DLL.h:220
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

◆ warning() [2/2]

void DLL::warning ( std::string  mymsg,
std::string  name 
)
inlineprivate

Definition at line 243 of file DLL.h.

References MsgSvc::msgSvc(), and MsgSvc::WARNING.

243 { m_log.msgSvc (MsgSvc::WARNING , mymsg, name ); }
std::string name()
Definition: DLL.h:108
MsgSvc m_log
Definition: DLL.h:219
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42

Member Data Documentation

◆ m_elementConstructors

std::vector<ConstructorElement> DLL::m_elementConstructors
private

Definition at line 225 of file DLL.h.

Referenced by createElement(), and init().

◆ m_elementDestructors

std::vector<DestructorElement> DLL::m_elementDestructors
private

Definition at line 226 of file DLL.h.

Referenced by destroy(), and init().

◆ m_handle

ImageHandle DLL::m_handle
private

Definition at line 221 of file DLL.h.

Referenced by init(), load(), and unload().

◆ m_listElements

listOfElements DLL::m_listElements
private

◆ m_listObjects

listOfObjects DLL::m_listObjects
private

Definition at line 224 of file DLL.h.

Referenced by addObject(), and listObjects().

◆ m_listProcessus

listOfProcessus DLL::m_listProcessus
private

◆ m_log

MsgSvc DLL::m_log
private

Definition at line 219 of file DLL.h.

◆ m_name

std::string DLL::m_name
private

Definition at line 220 of file DLL.h.

Referenced by name(), and setName().

◆ m_objectConstructors

std::vector<ConstructorObject> DLL::m_objectConstructors
private

Definition at line 229 of file DLL.h.

◆ m_objectDestructors

std::vector<DestructorObject> DLL::m_objectDestructors
private

Definition at line 230 of file DLL.h.

◆ m_processusConstructors

std::vector<ConstructorProcessus> DLL::m_processusConstructors
private

Definition at line 227 of file DLL.h.

Referenced by createProcessus(), and init().

◆ m_processusDestructors

std::vector<DestructorProcessus> DLL::m_processusDestructors
private

Definition at line 228 of file DLL.h.

Referenced by destroy(), and init().


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