File: Property.h

package info (click to toggle)
eris 1.2.1-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,360 kB
  • ctags: 1,348
  • sloc: sh: 8,289; cpp: 7,576; perl: 287; ansic: 172; makefile: 143
file content (43 lines) | stat: -rw-r--r-- 770 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef ERIS_PROPERTY_H
#define ERIS_PROPERTY_H

#include <sigc++/object.h>
#include <sigc++/signal.h>

namespace Atlas {
  namespace Message {
    class Element;
  }
}

namespace Eris
{
   
typedef SigC::Signal1<void, Atlas::Message::Element&> Getter;    
typedef SigC::Signal1<void, const Atlas::Message::Element&> Setter;

class Property : virtual public SigC::Object
{
public:    
    Getter Get;	///< emitted before the proeprty value is retrieved
    Setter Set;	///< emitted after the property value is set

    const Atlas::Message::Element& getValue()
    {
	Get.emit(_value);
	return _value;
    }

    void setValue(const Atlas::Message::Element& v)
    {
	_value = v;
	Set.emit(v);
    }
    
protected:
    Atlas::Message::Element _value;
};
    
}

#endif