Fire Core  8.0.0.alpha
GIS framework per tutti gli usi
 Tutto Classi Namespace Funzioni Variabili Ridefinizioni di tipo (typedef) Tipi enumerati (enum) Valori del tipo enumerato Friend
BufferSh.hpp
1 // Copyright © 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_PLUGIN_DATA_SHARED_BUFFERSH_HPP_INCLUDED
5 #define FIRE_PLUGIN_DATA_SHARED_BUFFERSH_HPP_INCLUDED
6 
7 #include <boost/shared_ptr.hpp>
8 #include <fire/shared/Shared.hpp>
9 
10 #include <exception>
11 
12 #include "fire/gis/export.hpp"
13 #include "fire/source/vector/Buffer.hpp"
14 
15 namespace fire {
16 namespace source {
17 namespace vector {
18 namespace shared {
19 
20 class FIRE_GIS_DLL BufferSh: public fire::shared::Shared< Buffer > {
21  public:
22  BufferSh(): Shared(NULL) {
23  }
24  explicit BufferSh(Buffer* ptr): Shared(ptr) {
25  }
26  explicit BufferSh(unsigned char* data, size_t const & sz): Shared(NULL) {
27  Buffer* buff = new Buffer(data, sz);
28  _ptr.reset(buff);
29  }
30  BufferSh(BufferSh const & c) {
31  this->operator =(c);
32  }
33 
34  inline BufferSh clone() const {
35  Buffer* buff = new Buffer(*_getPtr());
36  BufferSh ret(buff);
37  return ret;
38  }
39 
40  void reset(unsigned char * buff, size_t const & size) {
41  _getPtr()->reset(buff, size);
42  }
43  unsigned char const * getData() const {
44  return _getPtr()->getData();
45  }
46  unsigned char * getData() {
47  return _getPtr()->getData();
48  }
49  size_t getSize() const {
50  return _getPtr()->getSize();
51  }
52 };
53 
54 } // namespace shared
55 } // namespace vector
56 } // namespace source
57 } // namespace fire
58 
59 #endif
Definition: BufferSh.hpp:20
Definition: Shared.hpp:17
Oggetto che incapsula un array di byte con la sua lunghezza.
Definition: Buffer.hpp:27