Show
Ignore:
Timestamp:
08/11/09 08:32:02 (15 years ago)
Author:
vbarta
Message:

fixed UIREGISTER

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/user_info.h

    r483 r493  
    514514 
    515515 
    516 //! The only UI descendant class which is not intended for direct use. It should be accessed within the ::UIREGISTER macro only. 
     516//! The only UI descendant class which is not intended for direct use. It should be accessed within the UIREGISTER macro only. 
    517517//! \ref ui_page 
    518518template<typename T> class ParticularUI : private UI { 
    519 private: 
    520         //! Default constructor, which is intentionally declared as private 
     519public: 
     520        //! Constructor used by the UIREGISTER macro. 
    521521        ParticularUI<T> ( const string &class_name ) : UI ( class_name, &typeid ( T ) ) {}; 
    522  
    523 public: 
    524         //! The only instance of this class (each type T has its own instance) which is used as a factory for processing related UI 
    525         static const ParticularUI<T>& factory; 
    526522 
    527523        //! A method returning a brand new instance of class T, this method is the reason why there have to be a parameterless construcotor in class T 
     
    533529} 
    534530 
     531#define CONCATENATE0( name, line ) name##line 
     532#define CONCATENATE( name, line ) CONCATENATE0( name, line ) 
     533 
    535534/*! 
    536535  \def UIREGISTER(class_name) 
     
    543542*/ 
    544543#ifndef BDMLIB 
    545 #define UIREGISTER(class_name) template<> const ParticularUI<class_name>& ParticularUI<class_name>::factory = ParticularUI<class_name>(#class_name) 
     544#define UIREGISTER(class_name) static ParticularUI<class_name> CONCATENATE(registrator, __LINE__)(#class_name) 
    546545#else 
    547546#define UIREGISTER(class_name)