All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::gm::WKBWriter Class Reference

A class that serializes a geometry to the WKB format. More...

#include <WKBWriter.h>

Inheritance diagram for te::gm::WKBWriter:
te::gm::Visitor

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...
 

Detailed Description

A class that serializes a geometry to the WKB format.

See also
WKBReader

Definition at line 46 of file WKBWriter.h.

Constructor & Destructor Documentation

te::gm::WKBWriter::WKBWriter ( char *  wkb,
te::common::MachineByteOrder  byteOrder = te::common::NDR 
)

It constructs a new WKB writer.

Parameters
wkbA pointer to a buffer to output the wkb. It must have at least the size in bytes necessary to write the WKB.
byteOrderThe 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.

Member Function Documentation

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.

Parameters
wkbA pointer to a buffer to output the wkb. It must have at least the size in bytes necessary to write the WKB.
byteOrderThe byte order to be used to encode the WKB.

Definition at line 161 of file WKBWriter.cpp.

void te::gm::WKBWriter::visit ( const Curve )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 93 of file WKBWriter.h.

void te::gm::WKBWriter::visit ( const Geometry )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 94 of file WKBWriter.h.

void te::gm::WKBWriter::visit ( const LinearRing visited)
protectedvirtual

Implements te::gm::Visitor.

Definition at line 190 of file WKBWriter.cpp.

References te::gm::LineString::size(), and te::gm::Write2WKB().

void te::gm::WKBWriter::visit ( const LineString visited)
protectedvirtual
void te::gm::WKBWriter::visit ( const MultiCurve )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 98 of file WKBWriter.h.

void te::gm::WKBWriter::visit ( const MultiLineString visited)
protectedvirtual

Implements te::gm::Visitor.

Definition at line 209 of file WKBWriter.cpp.

void te::gm::WKBWriter::visit ( const MultiPoint visited)
protectedvirtual

Implements te::gm::Visitor.

Definition at line 214 of file WKBWriter.cpp.

void te::gm::WKBWriter::visit ( const MultiPolygon visited)
protectedvirtual

Implements te::gm::Visitor.

Definition at line 219 of file WKBWriter.cpp.

void te::gm::WKBWriter::visit ( const MultiSurface )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 102 of file WKBWriter.h.

void te::gm::WKBWriter::visit ( const AbstractPoint )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 103 of file WKBWriter.h.

void te::gm::WKBWriter::visit ( const Point visited)
protectedvirtual
void te::gm::WKBWriter::visit ( const PointKd )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 108 of file WKBWriter.h.

void te::gm::WKBWriter::visit ( const Surface )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 111 of file WKBWriter.h.

void te::gm::WKBWriter::visit ( const TIN visited)
protectedvirtual

Implements te::gm::Visitor.

Definition at line 350 of file WKBWriter.cpp.

void te::gm::WKBWriter::visit ( const Triangle visited)
protectedvirtual

Implements te::gm::Visitor.

Definition at line 355 of file WKBWriter.cpp.

void te::gm::WKBWriter::visit ( const CircularString )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 114 of file WKBWriter.h.

void te::gm::WKBWriter::visit ( const CompoundCurve )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 115 of file WKBWriter.h.

void te::gm::WKBWriter::visit ( const CurvePolygon )
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.

Parameters
geomThe geometry to be serialized.
Note
You must call reset in successive calls to this method.

Definition at line 149 of file WKBWriter.cpp.

References te::common::BaseVisitable< T, R >::accept().

Referenced by te::gm::Geometry::getWkb().

void te::gm::WKBWriter::write ( const Geometry geom,
char *  wkb,
te::common::MachineByteOrder  byteOrder = te::common::NDR 
)
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.

Parameters
geomThe geometry to be serialized.
wkbThe buffer where the geometry will be serialized.
byteOrderThe byte order used to store/serialize the geometry.

Definition at line 154 of file WKBWriter.cpp.

References te::common::BaseVisitable< T, R >::accept().

Member Data Documentation

te::common::MachineByteOrder te::gm::WKBWriter::m_byteOrder
private

The byte order used to encode the WKB.

Definition at line 121 of file WKBWriter.h.

char* te::gm::WKBWriter::m_wkb
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.


The documentation for this class was generated from the following files: