VideoSourceFactory Class Reference
[Videosource: Video acquisition abstraction]

The VideoSourceFactory class constructs valid VideoSource objects. More...

#include <videosource.h>

Collaboration diagram for VideoSourceFactory:

Collaboration graph
[legend]

List of all members.

Public Member Functions

DLLEXPORT VideoSourceFactory ()
DLLEXPORT ~VideoSourceFactory ()
DLLEXPORT void registerParameters (IniParser *parser)
 The registerParameters allow each driver to add it's own keywords in the .ini file grammar.
DLLEXPORT void registerParameters (ParamSection *sec)
 register parameters into an existing ParamSection
DLLEXPORT VideoSourceconstruct ()
 construct a valid and working VideoSource
DLLEXPORT void registerFactory (ParticularVSFactory *f)
 register a VideoSource driver.

Static Public Member Functions

static DLLEXPORT
VideoSourceFactory
instance ()
 Singleton implementation; gives access to the only VideoSourceFactory object.


Detailed Description

The VideoSourceFactory class constructs valid VideoSource objects.

Basically, it is just a directory of ParticularVSFactory and redirect registerParameters() and construct() calls to every factories.

The registerParameters allow each driver to add it's own keywords in the .ini file grammar. This call is optional, but provide runtime user configuration.

Here's how to use it:

VideoSourceFactory::instance()->registerParameters(&iniParser); VideoSource *vs = VideoSourceFactory::instance()->construct();

if (vs ==0) { // fail } // the vs object is valid and ready.

To add a new video source type, open videosource.cpp, look for the constructor, and call registerFactory().

Definition at line 153 of file videosource.h.


Constructor & Destructor Documentation

VideoSourceFactory::VideoSourceFactory (  ) 

Definition at line 78 of file videosource.cpp.

References registerFactory().

Referenced by instance().

VideoSourceFactory::~VideoSourceFactory (  ) 

Definition at line 122 of file videosource.cpp.


Member Function Documentation

VideoSource * VideoSourceFactory::construct (  ) 

construct a valid and working VideoSource

This method try to initialize all the registered drivers until a valid VideoSource is obtained.

Returns:
a working VideoSource or 0 on failure.

Definition at line 64 of file videosource.cpp.

Referenced by main().

VideoSourceFactory * VideoSourceFactory::instance (  )  [static]

Singleton implementation; gives access to the only VideoSourceFactory object.

Definition at line 73 of file videosource.cpp.

References VideoSourceFactory().

DLLEXPORT void VideoSourceFactory::registerFactory ( ParticularVSFactory f  )  [inline]

register a VideoSource driver.

calls to registerFactory are located in the VideoSourceFactory constructor, called once by instance().

Definition at line 184 of file videosource.h.

Referenced by VideoSourceFactory().

void VideoSourceFactory::registerParameters ( ParamSection sec  ) 

register parameters into an existing ParamSection

Definition at line 57 of file videosource.cpp.

void VideoSourceFactory::registerParameters ( IniParser parser  ) 

The registerParameters allow each driver to add it's own keywords in the .ini file grammar.

This call is optional, but provide runtime user configuration. Two versions of this method are available: one creates a new section, and the other one uses an existing section.

Definition at line 48 of file videosource.cpp.

References IniParser::addSection(), and IniSection::name.

Referenced by main().


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

Generated on Tue Mar 30 15:53:26 2010 for Polyora by  doxygen 1.5.9