client-cpp  0.0.1-SNAPSHOT
EmptyDeltaType.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 EMPTYDELTATYPE_HPP_
18 #define EMPTYDELTATYPE_HPP_
19 
20 #include <list>
21 
22 #include <avro/Generic.hh>
23 
25 
26 namespace kaa {
27 
28 class EmptyDeltaType : public IDeltaType {
29 public:
34  virtual bool isDefault() {
35  return false;
36  }
37 
42  virtual bool isReset() {
43  return false;
44  }
45 
50  virtual const DeltaValue& getNewValue() {
51  static DeltaValue empty;
52  return empty;
53  }
54 
59  virtual const RemovedItems& getRemovedItems() {
60  static RemovedItems emptyHandlerIdList;
61  return emptyHandlerIdList;
62  }
63 
68  virtual const AddedItems& getAddedItems() {
69  static AddedItems emptyAddedItemsList;
70  return emptyAddedItemsList;
71  }
72 
77  virtual std::string toString() const {
78  return std::string("null");
79  }
80 };
81 
82 } /* namespace kaa */
83 
84 #endif /* EMPTYDELTATYPE_HPP_ */
boost::any DeltaValue
Definition: IDeltaType.hpp:36
virtual const AddedItems & getAddedItems()
virtual const RemovedItems & getRemovedItems()
virtual std::string toString() const
std::list< DeltaValue > AddedItems
Definition: IDeltaType.hpp:37
virtual const DeltaValue & getNewValue()
virtual bool isDefault()
virtual bool isReset()
std::list< DeltaHandlerId > RemovedItems
Definition: IDeltaType.hpp:38