client-cpp  0.0.1-SNAPSHOT
ICommonRecord.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef I_COMMON_RECORD_HPP_
18 #define I_COMMON_RECORD_HPP_
19 
22 
23 #include <boost/uuid/uuid.hpp>
24 #include <map>
25 
26 namespace kaa {
27 
28 typedef boost::uuids::uuid uuid_t;
29 
33 template<class Container>
35 public:
36  typedef Container container_type;
37  typedef typename Container::mapped_type fields_type;
38  typedef typename Container::key_type keys_type;
39 
41  virtual ~ICommonRecordBase() {}
42 
46  virtual void setUuid(uuid_t uuid) = 0;
47 
51  virtual uuid_t getUuid() = 0;
52 
59  virtual bool hasField (const keys_type &field_name) const = 0;
60 
67  virtual fields_type getField (const keys_type &field_name) const = 0;
68 
74  virtual void setField (const keys_type &field_name, fields_type value) = 0;
75 
81  virtual void removeField (const keys_type &field_name) = 0;
82 
86  virtual const container_type & getFields () const = 0;
87 };
88 
90 
91 } // namespace kaa
92 
93 
94 #endif /* I_COMMON_RECORD_HPP_ */
virtual void removeField(const keys_type &field_name)=0
virtual void setField(const keys_type &field_name, fields_type value)=0
virtual uuid_t getUuid()=0
virtual bool hasField(const keys_type &field_name) const =0
virtual void setUuid(uuid_t uuid)=0
Container::mapped_type fields_type
boost::uuids::uuid uuid_t
virtual const container_type & getFields() const =0
virtual fields_type getField(const keys_type &field_name) const =0
Container::key_type keys_type
ICommonRecordBase< std::map< std::string, boost::shared_ptr< ICommonValue > > > ICommonRecord