client-cpp  0.0.1-SNAPSHOT
LogRecord.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 LOGRECORD_HPP_
18 #define LOGRECORD_HPP_
19 
20 #include <vector>
21 #include <boost/cstdint.hpp>
23 #include "kaa/log/gen/LogGen.hpp"
24 
25 namespace kaa {
26 
27 class LogRecord {
28 public:
29  LogRecord() {}
30  LogRecord(const SuperRecord & logRecord) {
31  SharedDataBuffer buffer = converter_.toByteArray(logRecord);
32 
33  for (size_t i = 0; i < buffer.second; i++) {
34  logData_.push_back(buffer.first[i]);
35  }
36  }
38 
39  const std::vector<boost::uint8_t>& getData();
40  size_t getSize() const;
41 
42 private:
44  std::vector<boost::uint8_t> logData_;
45 };
46 
47 } // namespace kaa
48 
49 
50 #endif /* LOGRECORD_HPP_ */
size_t getSize() const
const std::vector< boost::uint8_t > & getData()
std::pair< boost::shared_array< boost::uint8_t >, boost::uint32_t > SharedDataBuffer
SharedDataBuffer toByteArray(const T &datum)
LogRecord(const SuperRecord &logRecord)
Definition: LogRecord.hpp:30