1 // =========================================================================
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // =========================================================================
4 #ifndef __cpPlugins__Value__h__
5 #define __cpPlugins__Value__h__
9 #include <cpPlugins/Config.h>
14 // Some forward declarations...
17 /*! \brief Class to represent simple scalar values, independently from
20 struct CPPLUGINS_EXPORT Value
22 //! Output streaming operator overload
23 friend std::ostream& operator<<( std::ostream& o, const Value& v )
30 //! Simple typedef to be used by lazy programmers :-)
33 /*! @defgroup ScalarTypes
34 * Types that describe all base scalar values
38 typedef long TInteger;
39 typedef unsigned long TNatural;
40 typedef long double TReal;
41 typedef std::complex< TReal > TComplex;
42 typedef std::string TString;
45 /*! @defgroup Constructors
46 * Types that describe all base scalar values
49 //! Default constructor
52 //! Prepare a particular value
53 Value( const std::type_info& i );
55 //! Cast constructor(s)
56 Value( const Self& v );
58 Value( const {{s}}& v );
63 //! Output cast operator
65 explicit operator {{s}}( ) const;
68 //! Assignement operator
69 Self& operator=( const Self& v );
71 Self& operator=( const {{s}}& v );
74 //! Comparison operator
75 bool operator<( const Self& v ) const;
77 //! Return a string with contained type information.
78 const std::string& GetTypeName( ) const;
80 /*! @defgroup Pipeline
81 * Methods to synchronize values in processing pipelines
84 ProcessObject* GetSource( );
85 const ProcessObject* GetSource( ) const;
87 template< class _TObject >
88 void SetSource( _TObject* source );
91 //! Send information to a stream
92 void Print( std::ostream& o ) const;
95 /*! @ingroup ScalarTypes
96 * Types that describe all base scalar values
108 //! @ingroup Pipeline
109 std::weak_ptr< ProcessObject > m_Source;
114 #endif // __cpPlugins__Value__h__