Back to index

nux  3.0.0
Public Types | Public Member Functions | Public Attributes | Private Attributes
nux::SerializableProperty< VALUE_TYPE > Class Template Reference

#include <Property.h>

Inheritance diagram for nux::SerializableProperty< VALUE_TYPE >:
Inheritance graph
[legend]
Collaboration diagram for nux::SerializableProperty< VALUE_TYPE >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Property< VALUE_TYPE > Base
typedef type::PropertyTrait
< VALUE_TYPE > 
TraitType
typedef TraitType::ValueType ValueType
typedef PropertyChangedSignal
< VALUE_TYPE > 
SignalBase
typedef sigc::slot< bool,
VALUE_TYPE &, VALUE_TYPE const & > 
SetterFunction

Public Member Functions

 SerializableProperty (Introspectable *owner, std::string const &name)
 SerializableProperty (Introspectable *owner, std::string const &name, VALUE_TYPE const &initial)
virtual bool SetValue (std::string const &serialized_form)
virtual std::string GetSerializedValue () const
VALUE_TYPE operator= (VALUE_TYPE const &value)
 operator VALUE_TYPE () const
VALUE_TYPE operator() () const
VALUE_TYPE operator() (VALUE_TYPE const &value)
VALUE_TYPE Get () const
VALUE_TYPE Set (VALUE_TYPE const &value)
void SetSetterFunction (SetterFunction setter_function)
void DisableNotifications ()
void EnableNotifications ()
void EmitChanged (VALUE_TYPE const &new_value)

Public Attributes

sigc::signal< void, VALUE_TYPE
const & > 
changed

Private Attributes

std::string name_

Detailed Description

template<typename VALUE_TYPE>
class nux::SerializableProperty< VALUE_TYPE >

Definition at line 229 of file Property.h.


Member Typedef Documentation

template<typename VALUE_TYPE >
typedef Property<VALUE_TYPE> nux::SerializableProperty< VALUE_TYPE >::Base

Definition at line 232 of file Property.h.

template<typename VALUE_TYPE>
typedef sigc::slot<bool, VALUE_TYPE&, VALUE_TYPE const&> nux::Property< VALUE_TYPE >::SetterFunction [inherited]

Definition at line 71 of file Property.h.

template<typename VALUE_TYPE>
typedef PropertyChangedSignal<VALUE_TYPE> nux::Property< VALUE_TYPE >::SignalBase [inherited]

Definition at line 70 of file Property.h.

template<typename VALUE_TYPE >
typedef type::PropertyTrait<VALUE_TYPE> nux::SerializableProperty< VALUE_TYPE >::TraitType

Definition at line 233 of file Property.h.

template<typename VALUE_TYPE >
typedef TraitType::ValueType nux::SerializableProperty< VALUE_TYPE >::ValueType

Reimplemented from nux::Property< VALUE_TYPE >.

Definition at line 234 of file Property.h.


Constructor & Destructor Documentation

template<typename T >
nux::SerializableProperty< T >::SerializableProperty ( Introspectable owner,
std::string const &  name 
)

Definition at line 301 of file Property-inl.h.

  : Base()
  , name_(name)
{
  owner->AddProperty(name, this);
}

Here is the call graph for this function:

template<typename VALUE_TYPE >
nux::SerializableProperty< VALUE_TYPE >::SerializableProperty ( Introspectable owner,
std::string const &  name,
VALUE_TYPE const &  initial 
)

Member Function Documentation

template<typename VALUE_TYPE >
void nux::PropertyChangedSignal< VALUE_TYPE >::DisableNotifications ( ) [inherited]

Definition at line 34 of file Property-inl.h.

{
  notify_ = false;
}
template<typename VALUE_TYPE>
void nux::PropertyChangedSignal< VALUE_TYPE >::EmitChanged ( VALUE_TYPE const &  new_value) [inherited]

Definition at line 46 of file Property-inl.h.

{
  if (notify_)
    changed.emit(new_value);
}
template<typename VALUE_TYPE >
void nux::PropertyChangedSignal< VALUE_TYPE >::EnableNotifications ( ) [inherited]

Definition at line 40 of file Property-inl.h.

{
  notify_ = true;
}
template<typename VALUE_TYPE >
VALUE_TYPE nux::Property< VALUE_TYPE >::Get ( ) const [inherited]

Definition at line 97 of file Property-inl.h.

{
  return value_;
}
template<typename T >
std::string nux::SerializableProperty< T >::GetSerializedValue ( ) const [virtual]

Implements nux::PropertyBase.

Definition at line 330 of file Property-inl.h.

{
  return TraitType::to_string(Base::Get());
}
template<typename VALUE_TYPE >
nux::Property< VALUE_TYPE >::operator VALUE_TYPE ( ) const [inherited]

Definition at line 79 of file Property-inl.h.

{
  return value_;
}
template<typename VALUE_TYPE >
VALUE_TYPE nux::Property< VALUE_TYPE >::operator() ( ) const [inherited]

Definition at line 85 of file Property-inl.h.

{
  return value_;
}
template<typename VALUE_TYPE>
VALUE_TYPE nux::Property< VALUE_TYPE >::operator() ( VALUE_TYPE const &  value) [inherited]

Definition at line 91 of file Property-inl.h.

{
  return Set(value);
}
template<typename VALUE_TYPE >
T nux::SerializableProperty< T >::operator= ( VALUE_TYPE const &  value)

Reimplemented from nux::Property< VALUE_TYPE >.

Definition at line 336 of file Property-inl.h.

{
  Base::Set(value);
  // There are no arguments to ‘get’ that depend on a template parameter,
  // so we explicitly specify Base.
  return Base::Get();
}
template<typename VALUE_TYPE>
VALUE_TYPE nux::Property< VALUE_TYPE >::Set ( VALUE_TYPE const &  value) [inherited]

Definition at line 103 of file Property-inl.h.

template<typename VALUE_TYPE >
void nux::Property< VALUE_TYPE >::SetSetterFunction ( SetterFunction  setter_function) [inherited]

Definition at line 123 of file Property-inl.h.

{
  setter_function_ = setter_function;
}
template<typename T >
bool nux::SerializableProperty< T >::SetValue ( std::string const &  serialized_form) [virtual]

Implements nux::PropertyBase.

Definition at line 320 of file Property-inl.h.

{
  std::pair<ValueType, bool> result = TraitType::from_string(serialized_form);
  if (result.second) {
    Base::Set(result.first);
  }
  return result.second;
}

Member Data Documentation

template<typename VALUE_TYPE>
sigc::signal<void, VALUE_TYPE const&> nux::PropertyChangedSignal< VALUE_TYPE >::changed [inherited]

Definition at line 47 of file Property.h.

template<typename VALUE_TYPE >
std::string nux::SerializableProperty< VALUE_TYPE >::name_ [private]

Definition at line 249 of file Property.h.


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