Back to index

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

A read only property that uses a function to get the value. More...

#include <Property.h>

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

List of all members.

Public Types

typedef VALUE_TYPE ValueType
typedef sigc::slot< VALUE_TYPE > GetterFunction

Public Member Functions

 ROProperty ()
 ROProperty (GetterFunction getter_function)
 operator VALUE_TYPE () const
VALUE_TYPE operator() () const
VALUE_TYPE Get () const
void SetGetterFunction (GetterFunction getter_function)
void DisableNotifications ()
void EnableNotifications ()
void EmitChanged (VALUE_TYPE const &new_value)

Public Attributes

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

Private Member Functions

 ROProperty (ROProperty const &)
ROPropertyoperator= (ROProperty const &)
VALUE_TYPE DefaultGetter () const

Private Attributes

GetterFunction getter_function_

Detailed Description

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

A read only property that uses a function to get the value.

The default constructor creates a read only property that always returns the default constructed VALUE_TYPE.

Definition at line 111 of file Property.h.


Member Typedef Documentation

template<typename VALUE_TYPE>
typedef sigc::slot<VALUE_TYPE> nux::ROProperty< VALUE_TYPE >::GetterFunction

Definition at line 115 of file Property.h.

template<typename VALUE_TYPE>
typedef VALUE_TYPE nux::ROProperty< VALUE_TYPE >::ValueType

Definition at line 114 of file Property.h.


Constructor & Destructor Documentation

template<typename VALUE_TYPE >
nux::ROProperty< VALUE_TYPE >::ROProperty ( )

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

  : getter_function_(sigc::mem_fun(this, &ROProperty<VALUE_TYPE>::DefaultGetter))
{}
template<typename VALUE_TYPE >
nux::ROProperty< VALUE_TYPE >::ROProperty ( GetterFunction  getter_function) [explicit]

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

  : getter_function_(getter_function)
{}
template<typename VALUE_TYPE>
nux::ROProperty< VALUE_TYPE >::ROProperty ( ROProperty< VALUE_TYPE > const &  ) [private]

Member Function Documentation

template<typename VALUE_TYPE >
VALUE_TYPE nux::ROProperty< VALUE_TYPE >::DefaultGetter ( ) const [private]

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

{
  return VALUE_TYPE();
}
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::ROProperty< VALUE_TYPE >::Get ( ) const

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

{
  return getter_function_();
}
template<typename VALUE_TYPE >
nux::ROProperty< VALUE_TYPE >::operator VALUE_TYPE ( ) const

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

{
  return getter_function_();
}
template<typename VALUE_TYPE >
VALUE_TYPE nux::ROProperty< VALUE_TYPE >::operator() ( ) const

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

{
  return getter_function_();
}
template<typename VALUE_TYPE>
ROProperty& nux::ROProperty< VALUE_TYPE >::operator= ( ROProperty< VALUE_TYPE > const &  ) [private]
template<typename VALUE_TYPE >
void nux::ROProperty< VALUE_TYPE >::SetGetterFunction ( GetterFunction  getter_function)

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

{
  getter_function_ = getter_function;
}

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>
GetterFunction nux::ROProperty< VALUE_TYPE >::getter_function_ [private]

Definition at line 134 of file Property.h.


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