A class that serializes a geometry to the WKB format. More...
#include <WKBWriter.h>
Public Member Functions | |
| void | reset (char *wkb, te::common::MachineByteOrder byteOrder=te::common::NDR) |
| It resets the WKB writer an allows a new geometry to be seriealized to a new buffer. More... | |
| WKBWriter (char *wkb, te::common::MachineByteOrder byteOrder=te::common::NDR) | |
| It constructs a new WKB writer. More... | |
| void | write (const Geometry *geom) |
| It serializes the geometry to a WKB representation into the specified buffer. More... | |
| ~WKBWriter () | |
| Destructor. More... | |
Static Public Member Functions | |
| static void | write (const Geometry *geom, char *wkb, te::common::MachineByteOrder byteOrder=te::common::NDR) |
| It serializes the geometry to a WKB representation into the specified buffer. More... | |
Protected Member Functions | |
| void | visit (const Curve &) |
| void | visit (const Geometry &) |
| void | visit (const GeometryCollection &visited) |
| void | visit (const LinearRing &visited) |
| void | visit (const LineString &visited) |
| void | visit (const MultiCurve &) |
| void | visit (const MultiLineString &visited) |
| void | visit (const MultiPoint &visited) |
| void | visit (const MultiPolygon &visited) |
| void | visit (const MultiSurface &) |
| void | visit (const AbstractPoint &) |
| void | visit (const Point &visited) |
| void | visit (const PointM &visited) |
| void | visit (const PointZ &visited) |
| void | visit (const PointZM &visited) |
| void | visit (const PointKd &) |
| void | visit (const Polygon &visited) |
| void | visit (const PolyhedralSurface &visited) |
| void | visit (const Surface &) |
| void | visit (const TIN &visited) |
| void | visit (const Triangle &visited) |
| void | visit (const CircularString &) |
| void | visit (const CompoundCurve &) |
| void | visit (const CurvePolygon &) |
Private Attributes | |
| te::common::MachineByteOrder | m_byteOrder |
| The byte order used to encode the WKB. More... | |
| char * | m_wkb |
| A pointer that marks the current position in a buffer to be write when parsing the geometry. More... | |
A class that serializes a geometry to the WKB format.
Definition at line 46 of file WKBWriter.h.
| te::gm::WKBWriter::WKBWriter | ( | char * | wkb, |
| te::common::MachineByteOrder | byteOrder = te::common::NDR |
||
| ) |
It constructs a new WKB writer.
| wkb | A pointer to a buffer to output the wkb. It must have at least the size in bytes necessary to write the WKB. |
| byteOrder | The byte order to be used to encode the WKB. |
Definition at line 139 of file WKBWriter.cpp.
| te::gm::WKBWriter::~WKBWriter | ( | ) |
Destructor.
Definition at line 145 of file WKBWriter.cpp.
| void te::gm::WKBWriter::reset | ( | char * | wkb, |
| te::common::MachineByteOrder | byteOrder = te::common::NDR |
||
| ) |
It resets the WKB writer an allows a new geometry to be seriealized to a new buffer.
| wkb | A pointer to a buffer to output the wkb. It must have at least the size in bytes necessary to write the WKB. |
| byteOrder | The byte order to be used to encode the WKB. |
Definition at line 161 of file WKBWriter.cpp.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 93 of file WKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 94 of file WKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 167 of file WKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept(), te::gm::GeometryCollection::getGeometryN(), te::gm::Geometry::getGeomTypeId(), te::gm::GeometryCollection::getNumGeometries(), te::common::Globals::sm_machineByteOrder, and te::common::SwapBytes().
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 190 of file WKBWriter.cpp.
References te::gm::LineString::size(), and te::gm::Write2WKB().
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 195 of file WKBWriter.cpp.
References te::gm::Geometry::getGeomTypeId(), te::gm::LineString::size(), te::common::Globals::sm_machineByteOrder, te::common::Swap4Bytes(), and te::gm::Write2WKB().
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 98 of file WKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 209 of file WKBWriter.cpp.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 214 of file WKBWriter.cpp.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 219 of file WKBWriter.cpp.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 102 of file WKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 103 of file WKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 224 of file WKBWriter.cpp.
References te::gm::Geometry::getGeomTypeId(), te::gm::Point::getX(), te::gm::Point::getY(), te::common::Globals::sm_machineByteOrder, te::common::Swap4Bytes(), and te::common::Swap8Bytes().
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 243 of file WKBWriter.cpp.
References te::gm::Geometry::getGeomTypeId(), te::gm::PointM::getM(), te::gm::Point::getX(), te::gm::Point::getY(), te::common::Globals::sm_machineByteOrder, te::common::Swap4Bytes(), and te::common::Swap8Bytes().
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 264 of file WKBWriter.cpp.
References te::gm::Geometry::getGeomTypeId(), te::gm::Point::getX(), te::gm::Point::getY(), te::gm::PointZ::getZ(), te::common::Globals::sm_machineByteOrder, te::common::Swap4Bytes(), and te::common::Swap8Bytes().
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 285 of file WKBWriter.cpp.
References te::gm::Geometry::getGeomTypeId(), te::gm::PointZM::getM(), te::gm::Point::getX(), te::gm::Point::getY(), te::gm::PointZM::getZ(), te::common::Globals::sm_machineByteOrder, te::common::Swap4Bytes(), and te::common::Swap8Bytes().
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 108 of file WKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 308 of file WKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept(), te::gm::Geometry::getGeomTypeId(), te::gm::CurvePolygon::getNumRings(), te::gm::CurvePolygon::getRingN(), te::common::Globals::sm_machineByteOrder, and te::common::Swap4Bytes().
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 329 of file WKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept(), te::gm::Geometry::getGeomTypeId(), te::gm::PolyhedralSurface::getNumPatches(), te::gm::PolyhedralSurface::getPatchN(), te::common::Globals::sm_machineByteOrder, and te::common::Swap4Bytes().
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 111 of file WKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 350 of file WKBWriter.cpp.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 355 of file WKBWriter.cpp.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 114 of file WKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 115 of file WKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 116 of file WKBWriter.h.
| void te::gm::WKBWriter::write | ( | const Geometry * | geom | ) |
It serializes the geometry to a WKB representation into the specified buffer.
| geom | The geometry to be serialized. |
Definition at line 149 of file WKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept().
Referenced by te::gm::Geometry::getWkb().
|
static |
It serializes the geometry to a WKB representation into the specified buffer.
The wkb parameter must have at least geom.getWkbSize() in order to be used. Don't pass a NULL pointer or a buffer smaller than the size needed. Note that the WKB will be on the specified byte order.
| geom | The geometry to be serialized. |
| wkb | The buffer where the geometry will be serialized. |
| byteOrder | The byte order used to store/serialize the geometry. |
Definition at line 154 of file WKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept().
|
private |
The byte order used to encode the WKB.
Definition at line 121 of file WKBWriter.h.
|
private |
A pointer that marks the current position in a buffer to be write when parsing the geometry.
Definition at line 120 of file WKBWriter.h.