Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BaseFactory.hh
1 /* This file is part of the BIAS library (Basic ImageAlgorithmS).
2 
3  Copyright (C) 2003-2009 (see file CONTACT for details)
4  Multimediale Systeme der Informationsverarbeitung
5  Institut fuer Informatik
6  Christian-Albrechts-Universitaet Kiel
7 
8 
9  BIAS is free software; you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation; either version 2.1 of the License, or
12  (at your option) any later version.
13 
14  BIAS is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with BIAS; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
22 #ifndef __BaseFactory_hh__
23 #define __BaseFactory_hh__
24 
25 #include <bias_config.h>
26 
27 #include <Base/Common/FileHandling.hh>
28 #include <Base/Common/Singleton.hh>
29 #include <Base/Debug/Debug.hh>
30 #include <Base/Debug/LogFacility.hh>
31 
32 #include <cstring>
33 #include <vector>
34 #include <map>
35 #include <algorithm>
36 #ifndef WIN32
37 # include <stdio.h>
38 # include <sys/types.h>
39 # include <dirent.h>
40 # include <dlfcn.h>
41 #endif
42 
43 // #ifdef WIN32
44 // #include <Shlwapi.h> // for PathAppend()
45 // #endif
46 
47 namespace BIAS {
48 
49  template<class BaseClassType, class TagType> class BaseFactory;
50 
51  template<class BaseClassType, class TagType>
52  std::ostream &operator<<(std::ostream& os,
54 
55 
56 
57  /** @class BaseFactory
58  @brief simple factory class designed for usage as a singleton
59 
60  The factory differenciates between being used in a context
61  with dynamic libraries (*.so / *.dll) and being used in a static
62  library context (*.a / *.a).
63 
64  In a dynamic library context, the factory looks for possible candidates
65  for creation by itself by searching certain directories. These
66  directories are set using the Add2Directories() function. Each library
67  with name lib${PREFIX}*.so / ${PREFIX}*.dll is investigated. If it
68  contains a C-style function with signature
69  Base *create();
70  The associated class can be created with the factory. The create function
71  is very simple and typically created by adding
72  /code
73  #ifdef BIAS_BUILD_SHARED_LIBS
74  extern "C" TFModuleBase *create() { return new TFMSpecialModule();}
75  extern "C" void destroy(TFModuleBase *p) { delete p; }
76  #endif
77  /endcode
78  to the TFMSpecialModule.cpp file.
79 
80  In a static library context, the factory must be manually made aware of
81  the different classes which it manages. This is typically done by
82  calling the AddType() function of the directory.
83 
84 
85  Instantiate this class with the desired base class as template argument.
86  The base class must provide the functions
87  - TagType BaseClassType::GetTag() const
88  The instantiation will fail otherwise. Exemplary usage:
89 
90  /code
91 
92  typedef tag_type std::string
93 
94  class Base
95  {
96  public:
97  Base(const tag_type& name)
98  : Name_(name) {}
99  void Who() { cout << "I am "<<Name_<<endl; }
100  inline tag_type GetTag() const { return Name_; }
101  tag_type Name_;
102  };
103 
104  class A : public Base
105  {
106  public:
107  A() : Base("a") {};
108  static Base *Allocator() { return dynamic_cast<Base *>(new A); }
109  };
110 
111 
112  class B : public Base
113  {
114  public:
115  B() : Base("b") {};
116  static Base *Allocator() { return dynamic_cast<Base *>(new B); }
117  };
118 
119  BaseFactory<Base, tag_type> *factory =
120  FactorySingleton<Base, tag_type>::Factory.GetInstance();
121 
122  #ifdef BIAS_BUILD_SHARED_LIBS
123  // Make sure class A compiles in a library libMyPrefixA.so
124  // and that this library contains a C-style function similar to
125  // Base *create() { return new A; }
126  // The corresponding must be ensured for class B and each class
127  // managed by the factory
128  factory->SetPrefix("MyPrefix");
129  factory->Add2Directories("directory where libMyPrefixA.so resides");
130  factory->Add2Directories("directory where libMyPrefixB.so resides");
131  #else
132  // populate the factory (only necessary with static factories)
133  factory->AddType(&A::Allocator);
134  factory->AddType(&B::Allocator);
135  #endif
136 
137  Base *p = factory->Generate("a");
138 
139  /endcode
140 
141  @author woelk 10/2007 */
142  template<class BaseClassType, class TagType = std::string>
143  class BaseFactory
144  : public Singleton<BaseFactory<BaseClassType, TagType> >,BIAS::Debug
145  {
146  public:
147  /// typedef for function pointer to class allocator function
148  typedef BaseClassType* (*AllocatorFunctionPointer)();
149 
150 
151  static char GetSeperator() {
152 #ifdef WIN32
153  return';';
154 #else
155  return ':';
156 #endif
157  }
158  /// This function only makes sense when shared libraries are used:
159  /// Initialize the factory with ':' (linux) or ';' (windows) separated list of directories and a
160  /// lib_prefix. All shared libraries in the given directories
161  /// with names lib${lib_prefix}*.so (linux) resp.
162  /// ${lib_prefix}*.dll (windows)
163  /// are opened. An object can only be created when the library contains
164  /// a c-style function with the signature
165  /// BaseClass *create()
166  /// and hence all libraries not containing this symbol are neglected.
167  void Add2Directories(const std::string &directories);
168 
169  /// This function only makes sense when shared libraries are used:
170  /// Set the prefix used i
171  void SetPrefix(const std::string &prefix);
172 
173  /** @brief function for generic class generation from
174  @returns pointer to class on success, NULL on error */
175  BaseClassType *Generate(const TagType& tag);
176 
177  void GetNearTag(const TagType& tag, TagType& t1, TagType& t2) const;
178 
179  /** Searches for all available modules and gives all their tag.
180  @returns number of tags on success, negative value on error */
181  int GetKnownTags(std::vector<TagType>& tags) const;
182 
183 
184  /** Get all tags and associated filenames of all modules which
185  have been loaded already.
186  */
187  int GetLoadedFiles(std::vector<TagType>& tags,
188  std::vector<std::string>& files) const;
189 
190  /** This function is only meaningfull, when static libraries are used
191  @brief add a new class entry to map
192  @returns 0 on success, negative value on error */
193  void AddType(AllocatorFunctionPointer allocFunc);
194 
195  /** @brief empties the map, and unloads all shared libraries */
196  void Clear();
197 
198  friend std::ostream &
199  operator<<<>(std::ostream& os,
201 
202  /// the singleton must be able to use the base factory
203  friend class Singleton<BaseFactory<BaseClassType, TagType> >;
204  protected:
205  /// struct for storing class details in member map Map_
206  struct MapEntry {
207 #ifdef BIAS_BUILD_SHARED_LIBS
208 # ifdef WIN32
209  HMODULE DllHandle;
210 # else
211  void *DllHandle;
212 # endif
213 #endif
214  /// pointer to the static allocator function of this class
216  };
217 
218  /// tag - class allocator correspondences are stored in this map
219  std::map<TagType, MapEntry> Map_;
220 
221  // also remember used files, may be usefull for somebody
222  std::map<TagType, std::string> TagToFileMap_;
223 
224 
225  /// These members are onyl meaningfull when shared libraries are used
226  std::vector<std::string> Directories_;
227  std::string Prefix_;
228 
229  /// private constructor, the factory is designed as a singleton
230  BaseFactory();
231  BaseFactory(const BaseFactory& b);
232  BaseFactory& operator=(const BaseFactory& b);
233  /// destructor
234  ~BaseFactory();
235 
236  /// @brief checks if tag is already in map
237  inline bool IsInMap_(const TagType& tag) const
238  { return (Map_.find(tag) != Map_.end()); }
239 
240  /// This function is onyl meaningfull when shared libraries are used:
241  /// Search for all libraries with names lib${lib_prefix}*.so (linux) resp.
242  /// ${lib_prefix}*.dll (windows)
243  /// are opened. An object can only be created when the library contains
244  /// a c-style function with the signature
245  /// BaseClass *create()
246  /// and hence all libraries not containing this symbol are neglected.
247  void GetKnownTags_(std::vector<TagType> &tags,
248  const std::string& directory) const;
249 
250  /// This function is onyl meaningfull when shared libraries are used:
251  /// open file and store handle in DllMap
252  int OpenDll_(const std::string& tag);
253 
254 
255  }; // class BaseFactory
256 
257  /////////////////////////////////////////////////////////////////////////
258  // implementation
259  /////////////////////////////////////////////////////////////////////////
260 
261  template <class BaseClassType, class TagType>
264  : Map_(), Directories_(), Prefix_()
265  {}
266 
267 
268  template <class BaseClassType, class TagType>
271  : Map_(), Directories_(), Prefix_()
272  { BIASABORT; }
273 
274 
275  template <class BaseClassType, class TagType>
278  { Clear();
279  }
280 
281 
282  template <class BaseClassType, class TagType>
285  { BIASABORT; return *this; }
286 
287 
288  template <class BaseClassType, class TagType>
290  Add2Directories(const std::string &directories)
291  {
292 #ifdef BIAS_BUILD_SHARED_LIBS
293  char seperator;
294 #ifdef WIN32
295  seperator = ';';
296 #else
297  seperator = ':';
298 #endif
299  std::string::size_type pos = 0;
300  std::string::size_type offset = 0;
301  std::string directory;
302  while ( (pos = directories.find(seperator, offset)) != std::string::npos){
303  directory = directories.substr(offset, pos-offset);
304  Directories_.push_back(directory);
305  offset = pos+1;
306  }
307  directory = directories.substr(offset, directories.length()-offset);
308  Directories_.push_back(directory);
309 #endif
310  }
311 
312 
313  template <class BaseClassType, class TagType>
315  SetPrefix(const std::string &prefix)
316  {
317 #ifdef BIAS_BUILD_SHARED_LIBS
318  Prefix_ = prefix;
319 #endif
320  }
321 
322 
323  template <class BaseClassType, class TagType>
325  Generate(const TagType& tag)
326  {
327  BaseClassType *(*CreateFunc)() = NULL;
328  typename std::map<TagType, MapEntry>::const_iterator it;
329  it = Map_.find(tag);
330 #ifdef BIAS_BUILD_SHARED_LIBS
331  if (it == Map_.end()) {
332  if (OpenDll_(tag) < 0) {
333  return NULL;
334  }
335  }
336  CreateFunc = Map_[tag].AllocatorFunction_;
337 #else
338  if (it != Map_.end()){
339  CreateFunc = it->second.AllocatorFunction_;
340  } else {
341  BLF("failed to load static library for tag \""<<tag<<"\"");
342  return NULL;
343  }
344 #endif
345  BIASASSERT(CreateFunc != NULL);
346 
347  return CreateFunc();
348  }
349 
350 
351  template <class BaseClassType, class TagType>
353  GetNearTag(const TagType& tag, TagType& tagupper, TagType& taglower) const
354  {
355 //#ifdef BIAS_BUILD_SHARED_LIBS
356  std::vector<TagType> tags;
357  GetKnownTags(tags);
358  // insert searched tag and sort again
359  tags.push_back(tag);
360  std::sort(tags.begin(),tags.end());
361  unsigned int i=0;
362  while (tags[i] != tag && i<tags.size()) i++;
363  if (i>0 && i<tags.size()) tagupper = tags[i-1];
364  if (i<tags.size()) taglower = tags[i+1];
365 // #else
366 // tagupper = taglower = tag;
367 // // safety check if there is anything in the map
368 // if (Map_.empty()) return;
369 // typename std::map<TagType, MapEntry>::const_iterator el = Map_.find(tag);
370 // if (el != Map_.end()){
371 // // exact match !
372 // tagupper = taglower = tag;
373 // } else {
374 // // init with first
375 // tagupper = Map_.begin()->first;
376 // taglower = Map_.rbegin()->first;
377 // // generate element
378 // Map_[tag];
379 // // find neighbors
380 // typename std::map<TagType, MapEntry>::const_iterator it = Map_.find(tag);
381 // it++;
382 // if (it != Map_.end()) taglower = it->first;
383 // it--;
384 // if (it != Map_.begin()) {
385 // it--;
386 // tagupper = it->first;
387 // it++;
388 // }
389 // // cleanup synthetic element
390 // Map_.erase(it);
391 // }
392 //#endif
393  }
394 
395 
396  template <class BaseClassType, class TagType>
398  GetKnownTags(std::vector<TagType>& tags) const
399  {
400  tags.clear();
401 #ifdef BIAS_BUILD_SHARED_LIBS
402  std::vector<std::string> tmp;
403  typename std::vector<std::string>::const_iterator it;
404  for (it = Directories_.begin(); it!=Directories_.end(); it++){
405  GetKnownTags_(tmp, *it);
406  tags.insert(tags.begin(), tmp.begin(), tmp.end());
407  }
408 #else
409  typename std::map<TagType, MapEntry>::const_iterator it;
410  for (it=Map_.begin(); it!=Map_.end(); it++){
411  tags.push_back(it->first);
412  }
413 #endif
414  std::sort(tags.begin(),tags.end());
415  return (int)tags.size();
416  }
417 
418 
419  template <class BaseClassType, class TagType>
421  AddType(AllocatorFunctionPointer allocFunc)
422  {
423 #ifndef BIAS_BUILD_SHARED_LIBS
424  BaseClassType *cl = (*allocFunc)();
425  if (!cl){
426  BEXCEPTION("allocator function is not working!");
427  }
428 // if (cl->GetTag() == FACTORY_INVALID_TAG) {
429 // BEXCEPTION("can not add tag FACTORY_INVALID_TAG to factory!");
430 // }
431  if (IsInMap_(cl->GetTag())) {
432  BEXCEPTION("tag \""<<cl->GetTag()<<"\" already exists in factory instance!");
433  }
434  struct MapEntry me = { allocFunc };
435  Map_.insert(make_pair(cl->GetTag(), me));
436 
437  delete cl;
438 #endif
439  }
440 
441 
442  template <class BaseClassType, class TagType>
445  {
446 #ifdef BIAS_BUILD_SHARED_LIBS
447  typename std::map<TagType, MapEntry >::iterator it;
448  for (it = Map_.begin(); it!= Map_.end(); it++){
449 # ifdef WIN32
450  if (FreeLibrary(it->second.DllHandle)!=0) {
451  BLF("error unloading library \""<<it->first<<"\"!");
452  }
453 # else
454  if (dlclose(it->second.DllHandle)!=0) {
455  BLF("error unloading library \""<<it->first<<"\"!");
456  BLF("-> "<<dlerror());
457  }
458 # endif
459  BLD("unloaded library \""<<it->first<<"\"");
460  }
461 #endif
462  Map_.clear();
463  }
464 
465 
466  template <class BaseClassType, class TagType>
468  OpenDll_(const std::string& tag)
469  {
470 #ifdef BIAS_BUILD_SHARED_LIBS
471  typename std::vector<std::string>::const_iterator it;
472  std::string filename;
473  MapEntry NewModule;
474  NewModule.DllHandle = NULL;
475  std::string postfix;
476 # ifdef WIN32
477 # ifdef COMPILE_NDEBUG
478  postfix = ".dll";
479 # else //COMPILE_NDEBUG
480  postfix = "D.dll";
481 # endif //COMPILE_NDEBUG
482 # else
483 # ifdef __APPLE__
484 # ifdef COMPILE_NDEBUG
485  postfix = ".dylib";
486 # else //COMPILE_NDEBUG
487  postfix = "D.dylib";
488 # endif //COMPILE_NDEBUG
489 # else // __APPLE__
490 # ifdef COMPILE_NDEBUG
491  postfix = ".so";
492 # else //COMPILE_NDEBUG
493  postfix = "D.so";
494  # endif //COMPILE_NDEBUG
495 # endif // __APPLE__
496 # endif
497  for (it = Directories_.begin(); it!=Directories_.end(); it++) {
498  filename = *it + "/" + Prefix_ + tag + postfix;
499 # ifdef WIN32
500  NewModule.DllHandle = LoadLibrary(filename.c_str());
501 # else
502  NewModule.DllHandle = dlopen(filename.c_str(),RTLD_NOW);
503 # endif
504  if (NewModule.DllHandle != NULL) {
505  //BLD("loaded library \""<<filename<<"\"");
506  break;
507  } else {
508  BLF("failed to load library \""<<filename<<"\"!");
509 # ifndef WIN32
510  BLF("-> "<<dlerror());
511 # endif
512  }
513  }
514  if (!NewModule.DllHandle){
515  BLD("failed to load library \""<<Prefix_+tag+postfix<<"\" from :");
516  for (unsigned i=0; i<Directories_.size(); i++)
517  BLD(" "<< Directories_[i]);
518  return -1;
519  }
520 
521  std::string CreateSym;
522 # ifdef WIN32
523  // C++-function name are exported decorated in dll, so use C-style create only
524  CreateSym = "create";
525  NewModule.AllocatorFunction_ =
526  (AllocatorFunctionPointer)GetProcAddress(NewModule.DllHandle, CreateSym.c_str());
527 # else
528  CreateSym = "create";
529  // evil, evil, evil,...
530  void *damnedvoidpointer = dlsym(NewModule.DllHandle,CreateSym.c_str());
531  memcpy(&(NewModule.AllocatorFunction_), &damnedvoidpointer,sizeof(damnedvoidpointer));
532 
533  // NewModule.AllocatorFunction_ = (create_t*)damnedvoidpointer;
534  // NewModule.AllocatorFunction_ = (create_t*)dlsym(NewModule.DllHandle,
535  // CreateSym.c_str());
536 # endif
537  if (NewModule.AllocatorFunction_ == NULL) {
538  BLF("can not find symbol \""<<CreateSym<<"\" in file \""<<filename<<"\"");
539  return -2;
540  } else {
541  BLD("loaded library \""<<filename<<"\"");
542  TagToFileMap_[tag] = filename;
543  }
544 
545  // store pointer to dll and to Create() in map
546  Map_[tag] = NewModule;
547 #endif
548  return 0;
549  }
550 
551  template <class BaseClassType, class TagType>
553  GetKnownTags_(std::vector<TagType> &tags, const std::string& directory) const
554  {
555 #ifdef BIAS_BUILD_SHARED_LIBS
556  tags.clear();
557  std::string filename;
558 
559 # ifdef WIN32
560  std::string postfix;
561 # ifdef COMPILE_NDEBUG
562  postfix = ".dll";
563 # else //COMPILE_NDEBUG
564  postfix = "D.dll";
565 # endif //COMPILE_NDEBUG
566 
567  std::string tmp = directory + "/"+Prefix_+"*"+postfix;
568 
569  TCHAR searchPath[MAX_PATH];
570  // a wildcard needs to be added to the end of the path, e.g. "C:\*"
571  lstrcpy(searchPath, tmp.c_str());
572  // defined in shell lightweight API (v4.71)
573  // PathAppend(searchPath, "*");
574 
575  WIN32_FIND_DATA ffd; // file information struct
576  HANDLE sh = FindFirstFile(searchPath, &ffd);
577  if(INVALID_HANDLE_VALUE == sh) return; // not a proper path i guess
578 
579 
580  const int prefix_len = (int)Prefix_.length();
581  const int postfix_len = (int)postfix.length();
582  // enumerate all items; NOTE: FindFirstFile has already got info for
583  // an item
584  do {
585  //std::cout << "Name = " << ffd.cFileName << std::endl;
586  //std::cout << "Type = "
587  // << ( (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
588  // ? "dir\n" : "file\n" );
589  //std::cout << "Size = " << ffd.nFileSizeLow << std::endl;
590  filename = ffd.cFileName;
591  int l = (int)filename.length();
592  if (filename.substr(0,prefix_len) == Prefix_
593  && filename.substr(l-postfix_len) == postfix) {
594  filename = filename.substr(prefix_len,l-postfix_len-prefix_len);
595  tags.push_back(filename);
596  }
597  } while (FindNextFile(sh, &ffd));
598 
599  FindClose(sh);
600 # else
601  std::string postfix;
602 # ifdef COMPILE_NDEBUG
603  postfix = ".so";
604 # else //COMPILE_NDEBUG
605  postfix = "D.so";
606 # endif //COMPILE_NDEBUG
607 
608  DIR *dp;
609  struct dirent *ep;
610  dp = opendir (directory.c_str());
611  if (dp == NULL) {
612  perror (directory.c_str());
613  return ;
614  }
615  while ( (ep = readdir (dp)) != NULL) {
616  filename = ep->d_name;
617  int l = filename.length();
618  const int prefix_lenth = Prefix_.length();
619  const int postfix_len = postfix.length();
620  if (filename.substr(0,prefix_lenth) == Prefix_
621  && filename.substr(l-postfix_len) ==postfix) {
622  filename = filename.substr(prefix_lenth,l-prefix_lenth-postfix_len);
623  tags.push_back(filename);
624  }
625  }
626  (void) closedir (dp);
627 # endif
628  std::sort(tags.begin(),tags.end());
629 #endif
630  }
631 
632 
633 
634 
635  template <class BaseClassType, class TagType>
637  GetLoadedFiles(std::vector<TagType>& tags, std::vector<std::string>& files) const
638  {
639  files.clear();
640  tags.clear();
641  typename std::map<TagType,std::string>::const_iterator it;
642  it = TagToFileMap_.begin();
643  while(it !=TagToFileMap_.end()) {
644  tags.push_back(it->first);
645  files.push_back(it->second);
646  it++;
647  }
648  return (int)files.size();
649  }
650 
651 
652 
653 
654 
655  ///////////////////////////////////////////////////////////////
656  // iostream
657  ///////////////////////////////////////////////////////////////
658 
659  template <class BaseClassType, class TagType>
660  std::ostream &
661  operator<<(std::ostream& os,
663  {
664  typename std::map<TagType,
666  const_iterator it;
667  for (it=bf.Map_.begin(); it!=bf.Map_.end(); it++){
668  os <<"tag :"<<(it->first)<<std::endl;
669  }
670  return os;
671  }
672 } // namespace
673 
674 #endif // __BaseFactory_hh__
void SetPrefix(const std::string &prefix)
This function only makes sense when shared libraries are used: Set the prefix used i...
Definition: BaseFactory.hh:315
void Clear()
empties the map, and unloads all shared libraries
Definition: BaseFactory.hh:444
static char GetSeperator()
Definition: BaseFactory.hh:151
void GetNearTag(const TagType &tag, TagType &t1, TagType &t2) const
Definition: BaseFactory.hh:353
~BaseFactory()
destructor
Definition: BaseFactory.hh:277
void AddType(AllocatorFunctionPointer allocFunc)
This function is only meaningfull, when static libraries are used.
Definition: BaseFactory.hh:421
BaseClassType *(* AllocatorFunctionPointer)()
typedef for function pointer to class allocator function
Definition: BaseFactory.hh:148
struct for storing class details in member map Map_
Definition: BaseFactory.hh:206
BaseFactory()
private constructor, the factory is designed as a singleton
Definition: BaseFactory.hh:263
AllocatorFunctionPointer AllocatorFunction_
pointer to the static allocator function of this class
Definition: BaseFactory.hh:215
std::string Prefix_
Definition: BaseFactory.hh:227
std::map< TagType, MapEntry > Map_
tag - class allocator correspondences are stored in this map
Definition: BaseFactory.hh:219
std::ostream & operator<<(std::ostream &os, const Array2D< T > &arg)
Definition: Array2D.hh:260
int OpenDll_(const std::string &tag)
This function is onyl meaningfull when shared libraries are used: open file and store handle in DllMa...
Definition: BaseFactory.hh:468
void GetKnownTags_(std::vector< TagType > &tags, const std::string &directory) const
This function is onyl meaningfull when shared libraries are used: Search for all libraries with names...
Definition: BaseFactory.hh:553
int GetKnownTags(std::vector< TagType > &tags) const
Searches for all available modules and gives all their tag.
Definition: BaseFactory.hh:398
BaseClassType * Generate(const TagType &tag)
function for generic class generation from
Definition: BaseFactory.hh:325
void Add2Directories(const std::string &directories)
This function only makes sense when shared libraries are used: Initialize the factory with &#39;:&#39; (linux...
Definition: BaseFactory.hh:290
bool IsInMap_(const TagType &tag) const
checks if tag is already in map
Definition: BaseFactory.hh:237
BaseFactory & operator=(const BaseFactory &b)
Definition: BaseFactory.hh:284
std::map< TagType, std::string > TagToFileMap_
Definition: BaseFactory.hh:222
Simple singleton implementation for multithreaded applications.
Definition: Singleton.hh:86
std::vector< std::string > Directories_
These members are onyl meaningfull when shared libraries are used.
Definition: BaseFactory.hh:226
simple factory class designed for usage as a singleton
Definition: BaseFactory.hh:49
int GetLoadedFiles(std::vector< TagType > &tags, std::vector< std::string > &files) const
Get all tags and associated filenames of all modules which have been loaded already.
Definition: BaseFactory.hh:637