~charon-developers/charon-core/stable

« back to all changes in this revision

Viewing changes to include/charon-core/ParameteredObject.h

  • Committer: Jens Malte Gottfried
  • Date: 2013-06-13 16:55:41 UTC
  • Revision ID: jmgottfried@web.de-20130613165541-xjtaw0yxl9xy14u0
divided into charon-core charon-plugins charon-groups as base libs

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
#include "Slots.h"
46
46
#include "DllEx.h"
47
47
 
48
 
 
49
 
 
50
48
class PluginManagerInterface;
51
49
 
52
50
/// Base class for serializable objects
64
62
 
65
63
class charon_core_DLL_PUBLIC ParameteredObject {
66
64
private:
67
 
 
68
 
        /// status of initialization
69
 
        bool _initialized;
70
 
 
71
 
        /// Count number of parametered objects with different class names.
72
 
        static std::map<std::string, unsigned int> _genericClassNameCount;
73
 
 
74
65
        /// Specifies if the ParameteredObject should create metadata information
75
66
        static bool _createMetadata;
76
67
 
77
68
        /// Class tracking.
78
69
        /** This parameterfile is used for metadata generation
79
 
         *  and stores the class names with their parameters
80
 
         *  and slots.
 
70
         *  and stores the name of this class with its parameters and slots.
81
71
         */
82
72
        ParameterFile _metadata;
83
73
 
84
 
        /// Create unique name.
85
 
        /** The name consists of the class name and a number.
86
 
         *  The number is increased on every function call.
87
 
         *  \returns unique name
88
 
         */
89
 
        std::string charon_core_LOCAL _genericName();
90
 
 
91
74
        /// Class name.
92
75
        std::string _className;
93
76
 
103
86
        /// Output slots.
104
87
        std::map<std::string, Slot*> _outputs;
105
88
 
 
89
        /// status of initialization
 
90
        bool _initialized;
 
91
 
106
92
        /// status of execution (set to true during ParameteredObject::execute())
107
93
        bool _executed;
108
94
 
274
260
 
275
261
        /// Default constructor.
276
262
        /** Init class name with given string.
277
 
         *  Also generates a unique instance name if necessary.
 
263
         *  If no instance name is given, a dummy name "[className]0" is assumed.
 
264
         *  This name is not guaranteed to be unique.
 
265
         *  For auto-generation of unique names, use a PluginManager.
278
266
         *  \param className    Initialization value for className property.
279
267
         *  \param name         Instance name (auto generation if empty)
280
 
         *  \param doc  Class docstring (for metadata)
 
268
         *  \param doc          Class docstring (for metadata)
281
269
         */
282
270
        ParameteredObject(const std::string& className,
283
271
                const std::string& name = "", const std::string& doc = "");
327
315
                TYPE_INT = 2     ///< The template type of the instance is integer
328
316
        };
329
317
 
330
 
        /// defined build type, see static members for options
 
318
        /// defined build type
331
319
        enum build_type {
332
320
                /// The build type was not defined explicitly,
333
321
                /// make no assumptions about the release/debug configuration
336
324
                RELEASE_BUILD = 2    ///< the object was compiled in release mode
337
325
        };
338
326
 
339
 
        /// Converts template_type to std::string
340
 
        /** \param t            template type to convert
341
 
         *  \returns            string representation of t
342
 
         */
343
 
        static std::string templateTypeToString(template_type t);
344
 
 
345
327
        /// Delete parametered object.
346
328
        /** Updates the parametered object list (_objectList)
347
329
         */
388
370
        /// get execution status
389
371
        bool executed() const {
390
372
                return _executed;
391
 
    }
392
 
    // active inactive button
393
 
    Parameter < bool > _active;
 
373
        }
 
374
 
 
375
        /// ParameteredObject activation state
 
376
        /** If this is set to false, the Plugin will not be executed.
 
377
         */
 
378
        Parameter < bool > _active;
394
379
 
395
380
 
396
381
        /// deprecated macro
572
557
 
573
558
        bool isDynamic();
574
559
        //  \}
575
 
 
576
560
};
577
561
 
578
562
/// for transition to ParameteredObject::template_type
598
582
 
599
583
        virtual const std::string getTemplateType() const;
600
584
 
601
 
        virtual ~TemplatedParameteredObject();
 
585
        virtual ~TemplatedParameteredObject();
602
586
};
603
587
 
604
588