DataDirector API
ChunkProducerFactory.h
Go to the documentation of this file.
1 /*! \file ChunkProducerFactory.h
2  \brief The ChunkProducerFactory class. Factory for creating ChunkProducers.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2012 The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBLITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 
41 #ifndef _ChunkProducer_h_
42 #define _ChunkProducer_h_
43 
44 #include "DDD_Include.h"
45 #include "ChunkProducer.h"
46 #include "dynamic_ptr_array.h"
47 
48 namespace disti
49 {
50 
51 typedef ChunkProducer* (*ProducerCreateFunc)(void);
52 
53 class DDD_EXPORT ChunkProducerFactory
54 {
55 protected:
56  typedef struct
57  {
58  std::string _name; /**< Tag name */
59  ProducerCreateFunc _func; /**< Creator function */
61 
62  static DynamicPtrArray<ChunkProducerFactoryStruct *> _makerList; /**< The list of registered makers */
63 
64  /** Constructor */
66 
67  /** Destructor */
69 
70 public:
71  /** Public interface to the singleton
72  * \return Returns a pointer to the singleton instance
73  */
74  static ChunkProducerFactory& Instance();
75 
76  /** Registers a new producer type with the factory
77  * \param producerName The tag name associated with the producer
78  * \param func A function that creates a producer of the type specified by producerName
79  */
80  static void RegisterProducer(const std::string &producerName,ProducerCreateFunc func);
81 
82  /** \return Returns a new ChunkProducer instance of the type specified or NULL if
83  * no producer with that tag is registered
84  * \param producerName The type of producer to create
85  */
86  static ChunkProducer *CreateProducer(const std::string &producerName);
87 };
88 
89 } // end of namespace disti
90 #endif
91 
The ChunkProducer class.
A templated array of object pointers. The array dynamically resizes as needed.
Definition: dynamic_ptr_array.h:55
std::string _name
Definition: ChunkProducerFactory.h:58
Definition: ChunkProducerFactory.h:56
ProducerCreateFunc _func
Definition: ChunkProducerFactory.h:59
Definition: ChunkProducer.h:237
Definition: ChunkProducerFactory.h:53
static DynamicPtrArray< ChunkProducerFactoryStruct * > _makerList
Definition: ChunkProducerFactory.h:62
The disti::DynamicPtrArray class. A templated array of objects pointers capable of dynamically growin...
Definition: AttributeChangedEmitter.h:46