Socket Server: Rolled in separate command handler classes created by factory.

Translated several commands to the new regime.
p4#: 21645
This commit is contained in:
Jacob Støren 2013-05-16 11:14:57 +02:00
parent ac832866e6
commit 739c530fcf

View File

@ -28,14 +28,24 @@ namespace caf
//==================================================================================================
/// A generic Factory class template
/// Usage:
/// Initialization in source file (Initialization :
/// bool TypeToCreate_Factory_initialized = caf::Factory<BaseType, KeyType>::instance()->registerCreator<TypeToCreate>(key);
/*INIT_FACTORY(BaseType, KeyType,TypeToCreate )
bool TypeToCreate_Factory_initialized = caf::Factory<BaseType, KeyType>::instance()->registerCreator<TypeToCreate>(QString("TypeToCreate"));*/
/// Simply add the classes that is supposed to be created by the factory by doing the folowing:
///
/// caf::Factory<BaseType, KeyType>::instance()->registerCreator<TypeToCreate>(key);
///
/// This must only be done once for each TypeToCreate. It will assert if you try to do it several times.
/// This method returns a bool to make it possible to make this initialization as a static variable initialization.
/// That is useful if you do not want a centralized registering (but rather making each class register itself):
///
/// static bool uniqueVarname = caf::Factory<BaseType, KeyType>::instance()->registerCreator<TypeToCreate>(key);
///
/// See also cafPdmUiFieldEditorHandle.h for an advanced example.
///
/// When you need an object:
///
/// BaseType* newObject = caf::Factory<BaseType, KeyType>::instance()->create(key);
//==================================================================================================
template<typename BaseType, typename KeyType>
class Factory
{