synfig::ValueBase Class Reference

#include <value.h>

Inheritance diagram for synfig::ValueBase:

synfig::Value< T >

List of all members.

Public Types

enum  Type {
  TYPE_NIL = 0, TYPE_BOOL, TYPE_INTEGER, TYPE_ANGLE,
  TYPE_TIME, TYPE_REAL, TYPE_VECTOR, TYPE_COLOR,
  TYPE_SEGMENT, TYPE_BLINEPOINT, TYPE_LIST, TYPE_CANVAS,
  TYPE_STRING, TYPE_GRADIENT, TYPE_END
}

Public Member Functions

 ValueBase ()
template<typename T>
 ValueBase (const T &x, bool loop_=false)
 ValueBase (Type x)
 ~ValueBase ()
template<class T>
ValueBaseoperator= (const T &x)
ValueBaseoperator= (const ValueBase &x)
bool operator== (const ValueBase &rhs) const
bool operator!= (const ValueBase &rhs) const
const ValueBaseoperator[] (int index) const
 Constant index operator for when value is of type TYPE_LIST.
void clear ()
bool get_loop () const
void set_loop (bool x)
bool empty () const
Type get_contained_type () const
bool is_valid () const
 Returns true if the contained value is defined and valid.
String type_name () const
 Returns a string containing the name of the type.
const Typeget_type () const
 Returns the type of the contained value.
template<class T>
bool same_type_as (const T &x) const
 Checks the type of the parameter against itself. Returns true if they are of the same type.
bool same_type_as (const Type testtype) const
template<typename T>
const T & get (const T &x __attribute__((unused))) const
float get (const float &) const
etl::loose_handle< Canvasget (const etl::handle< Canvas > &) const
etl::loose_handle< Canvasget (Canvas *) const
const char * get (const char *) const
const list_type & get_list () const
template<typename T>
void put (T *x) const
void put (float *x) const
void put (char **x) const
template<typename T>
void set (const T &x)
void set (const float &x)
void set (const list_type &x)
void set (const char *x)
void set (char *x)
void set (Canvas *x)
void set (etl::loose_handle< Canvas > x)
void set (etl::handle< Canvas > x)
template<class T>
void set (const std::vector< T > &x)
template<class T>
void set (const std::list< T > &x)
 operator const list_type & () const
 operator const Real & () const
 operator const Vector & () const
 operator const BLinePoint & () const
 operator const Segment & () const
 operator const Angle & () const
template<class T>
 operator std::list< T > () const
template<class T>
 operator std::vector< T > () const

Static Public Member Functions

static bool same_type_as (const Type type1, const Type type2)
 Compares two types. Returns true if they are the same type.
static String type_name (Type id)
 Returns a string containing the name of the given Type.
static String type_local_name (Type id)
 Returns a string containing the translated name of the given Type.
static Type ident_type (const String &str)
 Returns a the corresponding Type of the described type.
static Type get_type (bool)
static Type get_type (int)
static Type get_type (const Time &)
static Type get_type (const Real &)
static Type get_type (const float &)
static Type get_type (const Vector &)
static Type get_type (const Color &)
static Type get_type (const Segment &)
static Type get_type (const BLinePoint &)
static Type get_type (const String &)
static Type get_type (const Gradient &)
static Type get_type (Canvas *)
static Type get_type (const etl::handle< Canvas > &)
static Type get_type (const etl::loose_handle< Canvas > &)
static Type get_type (const list_type &)
template<class T>
static Type get_type (const std::vector< T > &)
template<class T>
static Type get_type (const std::list< T > &)
static Type get_type (const Angle &)

Protected Attributes

Type type
void * data
etl::reference_counter ref_count
bool loop_


Detailed Description

Todo:
writeme

Member Enumeration Documentation

Todo:
This needs to be documented further.
Enumerator:
TYPE_NIL  Represents an empty value.
TYPE_BOOL 
TYPE_INTEGER 
TYPE_ANGLE  Angle.
TYPE_TIME  Time.
TYPE_REAL  Real.
TYPE_VECTOR  Vector.
TYPE_COLOR  Color.
TYPE_SEGMENT  Segment.
TYPE_BLINEPOINT  BLinePoint.
TYPE_LIST  List.
TYPE_CANVAS  Canvas.
TYPE_STRING  String.
TYPE_GRADIENT  Color Gradient.
TYPE_END  Not a valid type, used for sanity checks.


Constructor & Destructor Documentation

ValueBase::ValueBase (  ) 

Todo:
This needs to be documented further.

template<typename T>
synfig::ValueBase::ValueBase ( const T &  x,
bool  loop_ = false 
) [inline]

Todo:
This needs to be documented further.

ValueBase::ValueBase ( Type  x  ) 

ValueBase::~ValueBase (  ) 

Todo:
This needs to be documented further.

References clear().


Member Function Documentation

template<class T>
ValueBase& synfig::ValueBase::operator= ( const T &  x  )  [inline]

Todo:
This needs to be documented further.

Reimplemented in synfig::Value< T >.

ValueBase & ValueBase::operator= ( const ValueBase x  ) 

Todo:
This needs to be documented further.

Reimplemented in synfig::Value< T >.

References clear(), data, loop_, ref_count, and type.

bool ValueBase::operator== ( const ValueBase rhs  )  const

bool synfig::ValueBase::operator!= ( const ValueBase rhs  )  const [inline]

Todo:
This needs to be documented further.

References operator==().

const ValueBase& synfig::ValueBase::operator[] ( int  index  )  const [inline]

Constant index operator for when value is of type TYPE_LIST.

References get_list(), type, and TYPE_LIST.

void ValueBase::clear (  ) 

bool synfig::ValueBase::get_loop (  )  const [inline]

void synfig::ValueBase::set_loop ( bool  x  )  [inline]

Todo:
This needs to be documented further.

References loop_.

Referenced by Outline::sync().

bool ValueBase::empty (  )  const

ValueBase::Type ValueBase::get_contained_type (  )  const

Todo:
This needs to be documented further.

References empty(), get_list(), type, TYPE_LIST, and TYPE_NIL.

Referenced by synfig::ValueNode_BLine::create(), Region::sync(), and Outline::sync().

bool ValueBase::is_valid (  )  const

Returns true if the contained value is defined and valid.

References ref_count, type, TYPE_END, and TYPE_NIL.

Referenced by empty(), encode_layer(), and get().

String synfig::ValueBase::type_name (  )  const [inline]

Returns a string containing the name of the type.

References type.

Referenced by type_local_name().

const Type& synfig::ValueBase::get_type (  )  const [inline]

template<class T>
bool synfig::ValueBase::same_type_as ( const T &  x  )  const [inline]

bool synfig::ValueBase::same_type_as ( const Type  testtype  )  const [inline]

References same_type_as(), and type.

static bool synfig::ValueBase::same_type_as ( const Type  type1,
const Type  type2 
) [inline, static]

Compares two types. Returns true if they are the same type.

References TYPE_REAL, and TYPE_TIME.

template<typename T>
const T& synfig::ValueBase::get ( const T &x   __attribute__(unused)  )  const [inline]

float synfig::ValueBase::get ( const float &   )  const [inline]

etl::loose_handle<Canvas> synfig::ValueBase::get ( const etl::handle< Canvas > &   )  const [inline]

etl::loose_handle<Canvas> synfig::ValueBase::get ( Canvas  )  const [inline]

const char * ValueBase::get ( const char *   )  const

const list_type& synfig::ValueBase::get_list (  )  const [inline]

template<typename T>
void synfig::ValueBase::put ( T *  x  )  const [inline]

Reimplemented in synfig::Value< T >.

References data, and same_type_as().

Referenced by Star::set_param(), and synfig::Layer_PasteCanvas::set_param().

void synfig::ValueBase::put ( float *  x  )  const [inline]

void synfig::ValueBase::put ( char **  x  )  const

template<typename T>
void synfig::ValueBase::set ( const T &  x  )  [inline]

Reimplemented in synfig::Value< T >.

void synfig::ValueBase::set ( const float &  x  )  [inline]

void ValueBase::set ( const list_type &  x  ) 

void ValueBase::set ( const char *  x  ) 

void ValueBase::set ( char *  x  ) 

void ValueBase::set ( Canvas x  ) 

void ValueBase::set ( etl::loose_handle< Canvas x  ) 

References clear().

void ValueBase::set ( etl::handle< Canvas x  ) 

References clear().

template<class T>
void synfig::ValueBase::set ( const std::vector< T > &  x  )  [inline]

template<class T>
void synfig::ValueBase::set ( const std::list< T > &  x  )  [inline]

String ValueBase::type_name ( Type  id  )  [static]

String ValueBase::type_local_name ( Type  id  )  [static]

ValueBase::Type ValueBase::ident_type ( const String str  )  [static]

Returns a the corresponding Type of the described type.

References _, TYPE_ANGLE, TYPE_BLINEPOINT, TYPE_BOOL, TYPE_CANVAS, TYPE_COLOR, TYPE_GRADIENT, TYPE_INTEGER, TYPE_LIST, TYPE_NIL, TYPE_REAL, TYPE_SEGMENT, TYPE_STRING, TYPE_TIME, and TYPE_VECTOR.

static Type synfig::ValueBase::get_type ( bool   )  [inline, static]

References TYPE_BOOL.

static Type synfig::ValueBase::get_type ( int   )  [inline, static]

References TYPE_INTEGER.

static Type synfig::ValueBase::get_type ( const Time  )  [inline, static]

References TYPE_TIME.

static Type synfig::ValueBase::get_type ( const Real  )  [inline, static]

References TYPE_REAL.

static Type synfig::ValueBase::get_type ( const float &   )  [inline, static]

References TYPE_REAL.

static Type synfig::ValueBase::get_type ( const Vector  )  [inline, static]

References TYPE_VECTOR.

static Type synfig::ValueBase::get_type ( const Color  )  [inline, static]

References TYPE_COLOR.

static Type synfig::ValueBase::get_type ( const Segment  )  [inline, static]

References TYPE_SEGMENT.

static Type synfig::ValueBase::get_type ( const BLinePoint  )  [inline, static]

References TYPE_BLINEPOINT.

static Type synfig::ValueBase::get_type ( const String  )  [inline, static]

References TYPE_STRING.

static Type synfig::ValueBase::get_type ( const Gradient  )  [inline, static]

References TYPE_GRADIENT.

static Type synfig::ValueBase::get_type ( Canvas  )  [inline, static]

References TYPE_CANVAS.

static Type synfig::ValueBase::get_type ( const etl::handle< Canvas > &   )  [inline, static]

References TYPE_CANVAS.

static Type synfig::ValueBase::get_type ( const etl::loose_handle< Canvas > &   )  [inline, static]

References TYPE_CANVAS.

static Type synfig::ValueBase::get_type ( const list_type &   )  [inline, static]

References TYPE_LIST.

template<class T>
static Type synfig::ValueBase::get_type ( const std::vector< T > &   )  [inline, static]

References TYPE_LIST.

template<class T>
static Type synfig::ValueBase::get_type ( const std::list< T > &   )  [inline, static]

References TYPE_LIST.

synfig::ValueBase::operator const list_type & (  )  const [inline]

References get_list().

synfig::ValueBase::operator const Real & (  )  const [inline]

synfig::ValueBase::operator const Vector & (  )  const [inline]

synfig::ValueBase::operator const BLinePoint & (  )  const [inline]

synfig::ValueBase::operator const Segment & (  )  const [inline]

synfig::ValueBase::operator const Angle & (  )  const [inline]

static Type synfig::ValueBase::get_type ( const Angle  )  [inline, static]

References TYPE_ANGLE.

template<class T>
synfig::ValueBase::operator std::list< T > (  )  const [inline]

References get_list(), type, and TYPE_LIST.

template<class T>
synfig::ValueBase::operator std::vector< T > (  )  const [inline]

References get_list(), type, and TYPE_LIST.


Member Data Documentation

void* synfig::ValueBase::data [protected]

etl::reference_counter synfig::ValueBase::ref_count [protected]

Referenced by clear(), is_valid(), and operator=().

bool synfig::ValueBase::loop_ [protected]

Referenced by get_loop(), operator=(), and set_loop().


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

Generated on Fri Jul 31 00:01:59 2009 for synfig-core by  doxygen 1.5.6