synfig-core  1.0.3
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
synfig::ValueBase Class Reference

Base class for the Values of Synfig. More...

#include <value.h>

Inheritance diagram for synfig::ValueBase:
synfig::Value< T >

Public Types

typedef std::vector< ValueBaseList

Public Member Functions

 ValueBase ()
 Default constructor.
template<typename T >
 ValueBase (const T &x, bool loop_=false, bool static_=false)
 Template constructor for any type.
template<typename T >
 ValueBase (const std::vector< T > &x, bool loop_=false, bool static_=false)
 ValueBase (Type &x)
 Copy constructor. The data is not copied, just the type.
 ~ValueBase ()
 Default destructor.
template<class T >
ValueBaseoperator= (const T &x)
ValueBaseoperator= (const ValueBase &x)
 Operator asignation for ValueBase classes. Does a exact copy of .
bool operator== (const ValueBase &rhs) const
 Eqaul than operator. Segment, Gradient and Bline Points cannot be compared.
bool operator!= (const ValueBase &rhs) const
 Not equal than operator.
const ValueBaseoperator[] (int index) const
 Constant index operator for when value is of type TYPE_LIST.
void clear ()
 Deletes the data only if the ref count is zero.
bool get_loop () const
 Gets the loop option.
void set_loop (bool x)
 Sets the loop option.
bool get_static () const
 Gets the static option.
void set_static (bool x)
 Sets the static option.
Interpolation get_interpolation () const
 Gets the interpolation.
void set_interpolation (Interpolation x)
 Sets the interpolation.
void copy (const ValueBase &x)
 Create independent copy from existing ValueBase object.
void copy_properties_of (const ValueBase &x)
 Copies properties (static, interpolation, etc) from other ValueBase object.
bool empty () const
 True if the Value is not valid or is type LIST and is empty.
Typeget_contained_type () const
 Gets the contained type in the Value Base.
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. Used for sif files.
Typeget_type () const
 Returns the type of the contained value.
template<typename T >
bool can_get (const T &x) const
template<typename T >
bool can_set (const T &x) const
template<typename T >
bool can_put (const T &x) const
bool can_copy_from (const TypeId type) const
bool can_copy_from (const Type &type) const
bool can_copy_to (const TypeId type) const
bool can_copy_to (const Type &type) const
template<typename T >
bool same_type_as (const T &x) const
template<typename T >
const T & get (const T &x) const
 Template to get the ValueBase class data by casting the type.
const Listget_list () const
 Gets the data as List Type.
template<typename T >
std::vector< T > get_list_of (const T &x) const
template<typename T >
void set_list_of (const std::vector< T > &list)
template<typename T >
void put (T *x) const
 Put template for any class.
template<typename T >
void set (const T &x)
 Set template for any class.

Static Public Member Functions

template<typename T >
static bool can_get (const TypeId type, const T &x)
template<typename T >
static bool can_get (const Type &type, const T &x)
template<typename T >
static bool can_set (const TypeId type, const T &x)
template<typename T >
static bool can_set (const Type &type, const T &x)
template<typename T >
static bool can_put (const TypeId type, const T &x)
template<typename T >
static bool can_put (const Type &type, const T &x)
static bool can_copy (const TypeId dest, const TypeId src)
static bool can_copy (const Type &dest, const Type &src)
static Typeident_type (const String &str)
template<typename T >
static Typeget_type (const T &)
static Typeget_type (const List &)
static Typeget_type (Canvas *const &)
static Typeget_type (ValueNode_Bone *const &)
template<typename T >
static Typeget_type (const T *&)
template<typename T >
static Typeget_type (const std::vector< T > &)
template<typename T >
static Typeget_type (const std::list< T > &)

Protected Attributes

Typetype
 The type of value.
void * data
 Pointer to hold the data of the value.
etl::reference_counter ref_count
bool loop_
 For Values with loop option like TYPE_LIST.
bool static_
 For Values of Constant Value Nodes.
Interpolation interpolation_
 Parameter interpolation.

Detailed Description

Base class for the Values of Synfig.

Member Typedef Documentation

typedef std::vector<ValueBase> synfig::ValueBase::List

Constructor & Destructor Documentation

ValueBase::ValueBase ( )

Default constructor.

References synfig::Type::initialize(), and type.

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

Template constructor for any type.

References synfig::Type::initialize(), and type.

template<typename T >
synfig::ValueBase::ValueBase ( const std::vector< T > &  x,
bool  loop_ = false,
bool  static_ = false 
)
inline
ValueBase::ValueBase ( Type x)

Copy constructor. The data is not copied, just the type.

References synfig::Type::initialize(), and type.

ValueBase::~ValueBase ( )

Default destructor.

References clear().

Member Function Documentation

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

Template for the operator assignation operator for non ValueBase classes

See Also
set()

Reimplemented in synfig::Value< T >.

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

Operator asignation for ValueBase classes. Does a exact copy of .

Reimplemented in synfig::Value< T >.

References clear(), data, synfig::Operation::Description::get_copy(), synfig::Type::identifier, interpolation_, loop_, ref_count, static_, and type.

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

Eqaul than operator. Segment, Gradient and Bline Points cannot be compared.

References data, synfig::Operation::Description::get_compare(), synfig::Type::identifier, and type.

Referenced by operator!=().

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

Not equal than operator.

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 synfig::type_list.

void ValueBase::clear ( )

Deletes the data only if the ref count is zero.

References data, synfig::Operation::Description::get_destroy(), synfig::Type::identifier, ref_count, and synfig::type_nil.

Referenced by operator=(), and ~ValueBase().

bool synfig::ValueBase::get_loop ( ) const
inline
void synfig::ValueBase::set_loop ( bool  x)
inline

Sets the loop option.

References loop_.

Referenced by Outline::sync().

bool synfig::ValueBase::get_static ( ) const
inline

Gets the static option.

References static_.

Referenced by encode_layer(), encode_value(), and synfig::ValueNode_Const::get_static().

void synfig::ValueBase::set_static ( bool  x)
inline

Sets the static option.

References static_.

Referenced by synfig::ValueNode_Const::set_static().

Interpolation synfig::ValueBase::get_interpolation ( ) const
inline

Gets the interpolation.

References interpolation_.

Referenced by encode_value(), and synfig::ValueNode_Const::get_interpolation().

void synfig::ValueBase::set_interpolation ( Interpolation  x)
inline

Sets the interpolation.

References interpolation_.

Referenced by synfig::ValueNode_Const::set_interpolation().

void ValueBase::copy ( const ValueBase x)

Create independent copy from existing ValueBase object.

References copy_properties_of(), data, synfig::Operation::Description::get_copy(), synfig::Type::identifier, ref_count, and type.

void ValueBase::copy_properties_of ( const ValueBase x)

Copies properties (static, interpolation, etc) from other ValueBase object.

References interpolation_, loop_, and static_.

Referenced by copy().

bool ValueBase::empty ( ) const
Type & ValueBase::get_contained_type ( ) const
bool ValueBase::is_valid ( ) const

Returns true if the contained value is defined and valid.

References ref_count, type, and synfig::type_nil.

Referenced by can_get(), can_put(), empty(), and encode_layer().

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

Returns a string containing the name of the type. Used for sif files.

References synfig::Type::description, synfig::Type::Description::name, and type.

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

Returns the type of the contained value.

References type.

Referenced by synfig::ValueAverage::add(), synfig::ValueAverage::average(), synfig::ValueAverage::average_generic(), synfig::ValueAverage::average_weighted(), synfig::ValueVector::check_type(), synfig::ValueTransformation::check_type(), synfig::ValueAverage::check_type(), synfig::ValueNode_SegCalcVertex::create(), synfig::ValueNode_BLineCalcVertex::create(), synfig::ValueNode_SegCalcTangent::create(), synfig::ValueNode_BLineCalcWidth::create(), synfig::ValueNode_Const::create(), synfig::ValueNode_BLineCalcTangent::create(), synfig::ValueNode_GradientRotate::create(), synfig::ValueNode_Stripes::create(), synfig::ValueNode_BoneInfluence::create(), synfig::ValueNode_Repeat_Gradient::create(), synfig::ValueNode_DIList::create(), synfig::ValueNode_BLine::create(), synfig::ValueNode_WPList::create(), synfig::LinkableValueNode::create(), encode_animated(), encode_layer(), encode_value(), synfig::ValueVector::get_vector(), synfig::ValueAverage::multiply(), reverse_value(), synfig::ValueAverage::set_average_value(), synfig::ValueAverage::set_average_value_weighted(), synfig::ValueNode_Composite::set_link_vfunc(), CheckerBoard::set_param(), synfig::Layer_Skeleton::set_param(), Region::set_param(), synfig::Layer_Bitmap::set_param(), synfig::Layer_SphereDistort::set_param(), CurveGradient::set_param(), Outline::set_param(), Halftone3::set_param(), synfig::Layer_Polygon::set_param(), synfig::Layer_Shape::set_param(), synfig::ValueNode_Const::set_value(), synfig::ValueTransformation::transform(), synfig::ValueNode_Add::ValueNode_Add(), synfig::ValueNode_Bone::ValueNode_Bone(), synfig::ValueNode_Integer::ValueNode_Integer(), synfig::ValueNode_Real::ValueNode_Real(), synfig::ValueNode_Reverse::ValueNode_Reverse(), and synfig::ValueNode_Subtract::ValueNode_Subtract().

template<typename T >
static bool synfig::ValueBase::can_get ( const TypeId  type,
const T &  x 
)
inlinestatic
template<typename T >
static bool synfig::ValueBase::can_get ( const Type type,
const T &  x 
)
inlinestatic

References can_get(), and synfig::Type::identifier.

Referenced by can_get().

template<typename T >
static bool synfig::ValueBase::can_set ( const TypeId  type,
const T &  x 
)
inlinestatic
template<typename T >
static bool synfig::ValueBase::can_set ( const Type type,
const T &  x 
)
inlinestatic

References can_set(), and synfig::Type::identifier.

Referenced by can_set().

template<typename T >
static bool synfig::ValueBase::can_put ( const TypeId  type,
const T &  x 
)
inlinestatic
template<typename T >
static bool synfig::ValueBase::can_put ( const Type type,
const T &  x 
)
inlinestatic

References can_put(), and synfig::Type::identifier.

Referenced by can_put().

static bool synfig::ValueBase::can_copy ( const TypeId  dest,
const TypeId  src 
)
inlinestatic
static bool synfig::ValueBase::can_copy ( const Type dest,
const Type src 
)
inlinestatic

References can_copy(), and synfig::Type::identifier.

Referenced by can_copy().

template<typename T >
bool synfig::ValueBase::can_get ( const T &  x) const
inline

References can_get(), is_valid(), and type.

Referenced by can_get().

template<typename T >
bool synfig::ValueBase::can_set ( const T &  x) const
inline

References can_set(), and type.

Referenced by can_set().

template<typename T >
bool synfig::ValueBase::can_put ( const T &  x) const
inline

References can_put(), is_valid(), and type.

Referenced by can_put().

bool synfig::ValueBase::can_copy_from ( const TypeId  type) const
inline

References can_copy().

bool synfig::ValueBase::can_copy_from ( const Type type) const
inline

References can_copy().

bool synfig::ValueBase::can_copy_to ( const TypeId  type) const
inline

References can_copy().

bool synfig::ValueBase::can_copy_to ( const Type type) const
inline

References can_copy().

template<typename T >
bool synfig::ValueBase::same_type_as ( const T &  x) const
inline
template<typename T >
const T& synfig::ValueBase::get ( const T &  x) const
inline

Template to get the ValueBase class data by casting the type.

References synfig::types_namespace::get_type_alias().

Referenced by Blur_Layer::accelerated_cairorender(), synfig::Layer_SolidColor::accelerated_cairorender(), SuperSample::accelerated_cairorender(), Zoom::accelerated_cairorender(), Translate::accelerated_cairorender(), synfig::Layer_Stretch::accelerated_cairorender(), Layer_Shade::accelerated_cairorender(), synfig::Layer_MotionBlur::accelerated_cairorender(), RadialBlur::accelerated_cairorender(), Rotate::accelerated_cairorender(), SimpleCircle::accelerated_cairorender(), CheckerBoard::accelerated_cairorender(), Rectangle::accelerated_cairorender(), synfig::Layer_SphereDistort::accelerated_cairorender(), Layer_Bevel::accelerated_cairorender(), ConicalGradient::accelerated_cairorender(), FilledRect::accelerated_cairorender(), RadialGradient::accelerated_cairorender(), CurveWarp::accelerated_cairorender(), synfig::Layer_Bitmap::accelerated_cairorender(), Halftone2::accelerated_cairorender(), LinearGradient::accelerated_cairorender(), Halftone3::accelerated_cairorender(), Warp::accelerated_cairorender(), synfig::Layer_Composite::accelerated_cairorender(), synfig::Layer_Shape::accelerated_cairorender(), Circle::accelerated_cairorender(), synfig::Layer_PasteCanvas::accelerated_cairorender(), Blur_Layer::accelerated_render(), SuperSample::accelerated_render(), synfig::Layer_SolidColor::accelerated_render(), Zoom::accelerated_render(), Translate::accelerated_render(), synfig::Layer_Stretch::accelerated_render(), Layer_Shade::accelerated_render(), synfig::Layer_MotionBlur::accelerated_render(), RadialBlur::accelerated_render(), Rotate::accelerated_render(), CheckerBoard::accelerated_render(), Rectangle::accelerated_render(), synfig::Layer_SphereDistort::accelerated_render(), Layer_Bevel::accelerated_render(), Metaballs::accelerated_render(), FilledRect::accelerated_render(), CurveWarp::accelerated_render(), synfig::Layer_Bitmap::accelerated_render(), Halftone2::accelerated_render(), Halftone3::accelerated_render(), Warp::accelerated_render(), synfig::Layer_Composite::accelerated_render(), synfig::Layer_Shape::accelerated_render(), Circle::accelerated_render(), synfig::Layer_PasteCanvas::accelerated_render(), synfig::ValueAverage::add(), Plant::calc_bounding_rect(), Circle::compile_gradient(), synfig::ValueNode_GradientRotate::create(), synfig::ValueNode_Repeat_Gradient::create(), synfig::ValueNode_StaticList::create_list_entry(), synfig::ValueNode_DynamicList::create_list_entry(), encode_animated(), encode_layer(), encode_value(), synfig::Layer_Shape::feather_cairo_surface(), synfig::Layer_Sound::fill_sound_processor(), synfig::Layer_Composite::get_amount(), synfig::Layer_Composite::get_blend_method(), Rectangle::get_bounding_rect(), synfig::Layer_Bitmap::get_bounding_rect(), synfig::Layer_SphereDistort::get_bounding_rect(), NoiseDistort::get_bounding_rect(), synfig::Layer_Shape::get_bounding_rect(), Circle::get_bounding_rect(), InsideOut::get_cairocolor(), Metaballs::get_cairocolor(), Blur_Layer::get_color(), synfig::Layer_SolidColor::get_color(), Zoom::get_color(), InsideOut::get_color(), Translate::get_color(), synfig::Layer_Stretch::get_color(), Layer_Shade::get_color(), XORPattern::get_color(), CheckerBoard::get_color(), Rotate::get_color(), SimpleCircle::get_color(), Rectangle::get_color(), synfig::Layer_SphereDistort::get_color(), Metaballs::get_color(), Layer_Bevel::get_color(), Warp::get_color(), Mandelbrot::get_color(), Julia::get_color(), Circle::get_color(), synfig::Layer_Shape::get_color(), Blur_Layer::get_full_bounding_rect(), Zoom::get_full_bounding_rect(), Translate::get_full_bounding_rect(), Layer_Shade::get_full_bounding_rect(), synfig::Layer_Stretch::get_full_bounding_rect(), Rectangle::get_full_bounding_rect(), Layer_Bevel::get_full_bounding_rect(), Warp::get_full_bounding_rect(), Circle::get_full_bounding_rect(), synfig::ValueNode_Real::get_inverse(), synfig::Layer::get_local_name(), synfig::Layer::get_name(), synfig::Layer_PasteCanvas::get_origin(), Import::get_param(), Mandelbrot::get_param(), Julia::get_param(), synfig::Layer_PasteCanvas::get_time_dilation(), synfig::Layer_PasteCanvas::get_time_offset(), synfig::Layer_PasteCanvas::get_times_vfunc(), synfig::Layer_PasteCanvas::get_transformation(), synfig::ValueVector::get_vector(), synfig::Layer_Mime::get_version(), synfig::Layer::get_version(), synfig::Layer::get_z_depth(), Halftone3::Halftone3(), Zoom::hit_check(), InsideOut::hit_check(), synfig::Layer_SolidColor::hit_check(), synfig::Layer_Stretch::hit_check(), Translate::hit_check(), Rotate::hit_check(), SimpleCircle::hit_check(), Rectangle::hit_check(), synfig::Layer_SphereDistort::hit_check(), synfig::Layer_Bitmap::hit_check(), Warp::hit_check(), synfig::Layer_Shape::hit_check(), Circle::hit_check(), synfig::Layer_PasteCanvas::hit_check(), Star::import_parameters(), synfig::Layer_Composite::is_disabled(), Rectangle::is_solid_color(), synfig::Layer_Composite::is_solid_color(), Julia::Julia(), Mandelbrot::Mandelbrot(), synfig::ValueAverage::multiply(), synfig::optimize_layers(), synfig::Layer_SkeletonDeformation::prepare_mesh(), reverse_value(), Blur_Layer::set_param(), synfig::Layer_SolidColor::set_param(), svg_layer::set_param(), SuperSample::set_param(), Layer_Shade::set_param(), CheckerBoard::set_param(), Rectangle::set_param(), Rotate::set_param(), Import::set_param(), synfig::Layer_ColorCorrect::set_param(), synfig::Layer_Bitmap::set_param(), Layer_Bevel::set_param(), FilledRect::set_param(), synfig::Layer_Composite::set_param(), Advanced_Outline::set_param(), Mandelbrot::set_param(), Julia::set_param(), synfig::Layer_Shape::set_param(), Plant::set_param(), synfig::Layer_PasteCanvas::set_param(), Import::set_time(), synfig::Layer_PasteCanvas::set_time(), synfig::ValueNode_Const::set_value(), Star::sync(), Warp::sync(), Advanced_Outline::sync(), CurveWarp::transform(), synfig::ValueTransformation::transform(), synfig::ValueNode_Add::ValueNode_Add(), synfig::ValueNode_And::ValueNode_And(), synfig::ValueNode_Bone::ValueNode_Bone(), synfig::ValueNode_Compare::ValueNode_Compare(), synfig::ValueNode_Duplicate::ValueNode_Duplicate(), synfig::ValueNode_Integer::ValueNode_Integer(), synfig::ValueNode_Logarithm::ValueNode_Logarithm(), synfig::ValueNode_Not::ValueNode_Not(), synfig::ValueNode_Or::ValueNode_Or(), synfig::ValueNode_Pow::ValueNode_Pow(), synfig::ValueNode_Real::ValueNode_Real(), synfig::ValueNode_Reciprocal::ValueNode_Reciprocal(), and synfig::ValueNode_Subtract::ValueNode_Subtract().

const List& synfig::ValueBase::get_list ( ) const
inline
template<typename T >
std::vector<T> synfig::ValueBase::get_list_of ( const T &  x) const
inline
template<typename T >
void synfig::ValueBase::set_list_of ( const std::vector< T > &  list)
inline
template<typename T >
void synfig::ValueBase::put ( T *  x) const
inline
template<typename T >
void synfig::ValueBase::set ( const T &  x)
inline
Type & ValueBase::ident_type ( const String str)
static

Returns a the corresponding Type of the described type. Notice that this is used in the loadcanvas. It should keep all all type names used in previous sif files

References synfig::Type::try_get_type_by_name(), type, and synfig::type_nil.

template<typename T >
static Type& synfig::ValueBase::get_type ( const T &  )
inlinestatic
static Type& synfig::ValueBase::get_type ( const List )
inlinestatic
static Type& synfig::ValueBase::get_type ( Canvas *const &  )
inlinestatic
static Type& synfig::ValueBase::get_type ( ValueNode_Bone *const &  )
inlinestatic
template<typename T >
static Type& synfig::ValueBase::get_type ( const T *&  )
inlinestatic

References synfig::type_nil.

template<typename T >
static Type& synfig::ValueBase::get_type ( const std::vector< T > &  )
inlinestatic

References synfig::type_nil.

template<typename T >
static Type& synfig::ValueBase::get_type ( const std::list< T > &  )
inlinestatic

References synfig::type_nil.

Member Data Documentation

Type* synfig::ValueBase::type
protected
void* synfig::ValueBase::data
protected

Pointer to hold the data of the value.

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

etl::reference_counter synfig::ValueBase::ref_count
protected

Counter of Value Nodes that refers to this Value Base Value base can only be destructed if the ref_count is not greater than 0

See Also
etl::reference_counter

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

bool synfig::ValueBase::loop_
protected

For Values with loop option like TYPE_LIST.

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

bool synfig::ValueBase::static_
protected

For Values of Constant Value Nodes.

Referenced by copy_properties_of(), get_static(), operator=(), and set_static().

Interpolation synfig::ValueBase::interpolation_
protected

Parameter interpolation.

Referenced by copy_properties_of(), get_interpolation(), operator=(), and set_interpolation().


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