cartobase 6.0.6
headered.h
Go to the documentation of this file.
1/* This software and supporting documentation are distributed by
2 * Institut Federatif de Recherche 49
3 * CEA/NeuroSpin, Batiment 145,
4 * 91191 Gif-sur-Yvette cedex
5 * France
6 *
7 * This software is governed by the CeCILL-B license under
8 * French law and abiding by the rules of distribution of free software.
9 * You can use, modify and/or redistribute the software under the
10 * terms of the CeCILL-B license as circulated by CEA, CNRS
11 * and INRIA at the following URL "http://www.cecill.info".
12 *
13 * As a counterpart to the access to the source code and rights to copy,
14 * modify and redistribute granted by the license, users are provided only
15 * with a limited warranty and the software's author, the holder of the
16 * economic rights, and the successive licensors have only limited
17 * liability.
18 *
19 * In this respect, the user's attention is drawn to the risks associated
20 * with loading, using, modifying and/or developing or reproducing the
21 * software by the user in light of its specific status of free software,
22 * that may mean that it is complicated to manipulate, and that also
23 * therefore means that it is reserved for developers and experienced
24 * professionals having in-depth computer knowledge. Users are therefore
25 * encouraged to load and test the software's suitability as regards their
26 * requirements in conditions enabling the security of their systems and/or
27 * data to be ensured and, more generally, to use and operate it in the
28 * same conditions as regards security.
29 *
30 * The fact that you are presently reading this means that you have had
31 * knowledge of the CeCILL-B license and that you accept its terms.
32 */
33
34#ifndef CARTOBASE_OBJECT_HEADERED_H
35#define CARTOBASE_OBJECT_HEADERED_H
36
37
43#include <map>
44#include <set>
45
46
47namespace carto
48{
49
50
51class Headered : virtual public RCObject, public Observable, public Observer
52{
53
54 public:
55
57 Headered( const Headered& other );
58 virtual ~Headered();
59
60 Headered& operator = ( const Headered& other );
61
62 const PropertySet& header() const;
64
65 void addPropertyFilter( const rc_ptr< PropertyFilter >& propertyFilter );
66 bool hasPropertyFilter( const std::string& propertyFilterName ) const;
67 bool connect( const std::string& propertyFilterName,
68 const PropertyFilter::Slot& slot );
69 bool disconnect( const std::string& propertyFilterName,
70 const PropertyFilter::Slot& slot );
71
72 std::set< rc_ptr< PropertyFilter > >
73 getPropertyFilters( const std::string& propertyName ) const;
74
75 void delay();
76 void flush();
77 void blockSignals( bool );
78 bool signalsBlocked() const;
79
80 virtual void initialize();
81
83 std::string uuid();
87 bool copyUuid( const PropertySet & );
88 bool copyUuid( const Headered & );
89
90 private:
91
92 void slotPropertyChanged( const Object& sender,
93 const std::string& propertyName,
94 const Object& oldValue );
95
96 PropertySet _propertySet;
97 bool _delayed;
98 bool _blocked;
99 std::set< rc_ptr< PropertyFilter > > _propertyFilters;
100 std::set< rc_ptr< PropertyFilter > > _delayedEmissions;
101
102};
103
104
105 template <typename T> inline
107 {
108 return Object::reference( h.header() );
109 }
110
111}
112
113
114#endif
PropertySet & header()
const PropertySet & header() const
void blockSignals(bool)
bool signalsBlocked() const
std::set< rc_ptr< PropertyFilter > > getPropertyFilters(const std::string &propertyName) const
std::string uuid()
retrieve or generate an UUID - this method intentionally is non-const
bool hasPropertyFilter(const std::string &propertyFilterName) const
Headered(const Headered &other)
bool connect(const std::string &propertyFilterName, const PropertyFilter::Slot &slot)
void addPropertyFilter(const rc_ptr< PropertyFilter > &propertyFilter)
Headered & operator=(const Headered &other)
virtual void initialize()
bool copyUuid(const Headered &)
bool disconnect(const std::string &propertyFilterName, const PropertyFilter::Slot &slot)
virtual ~Headered()
bool copyUuid(const PropertySet &)
take the UUID from another header and set it to this.
static Object reference(T &value)
factory function: builds an Object by referencing the value from a ReferenceObject storage wrapper.
Definition object.h:1546
::sigc::slot1< void, const PropertyFilter & > Slot
A dictionary generic Object.
Definition property.h:77
Reference-counting pointer.
Definition rcptr.h:640
carto::Object getObjectHeader(Headered &h)
Definition headered.h:106
::sigc::trackable Observable
Definition observable.h:46