te::pgis::EWKBWriter Class Reference

An utility class for writing a PostGIS EWKB. More...

#include <EWKBWriter.h>

Inheritance diagram for te::pgis::EWKBWriter:
te::gm::Visitor

Public Member Functions

 EWKBWriter (char *ewkb, te::common::MachineByteOrder byteOrder=te::common::NDR)
 It constructs a new EWKB writer. More...
 
void reset (char *ewkb, te::common::MachineByteOrder byteOrder=te::common::NDR)
 It resets the EWKB writer an allows a new geometry to be seriealized to a new buffer. More...
 
void write (const te::gm::Geometry *geom)
 It serializes the geometry to an EWKB representation into the specified buffer. More...
 
 ~EWKBWriter ()
 Destructor. More...
 

Static Public Member Functions

static void write (const te::gm::Geometry *geom, char *ewkb, te::common::MachineByteOrder byteOrder=te::common::NDR)
 It serializes the geometry to an EWKB representation into the specified buffer. More...
 

Protected Member Functions

void visit (const te::gm::Curve &)
 
void visit (const te::gm::Geometry &)
 
void visit (const te::gm::GeometryCollection &visited)
 
void visit (const te::gm::LinearRing &visited)
 
void visit (const te::gm::LineString &visited)
 
void visit (const te::gm::MultiCurve &)
 
void visit (const te::gm::MultiLineString &visited)
 
void visit (const te::gm::MultiPoint &visited)
 
void visit (const te::gm::MultiPolygon &visited)
 
void visit (const te::gm::MultiSurface &)
 
void visit (const te::gm::AbstractPoint &)
 
void visit (const te::gm::Point &visited)
 
void visit (const te::gm::PointM &visited)
 
void visit (const te::gm::PointZ &visited)
 
void visit (const te::gm::PointZM &visited)
 
void visit (const te::gm::PointKd &)
 
void visit (const te::gm::Polygon &visited)
 
void visit (const te::gm::PolyhedralSurface &)
 
void visit (const te::gm::Surface &)
 
void visit (const te::gm::TIN &)
 
void visit (const te::gm::Triangle &)
 
void visit (const te::gm::CircularString &)
 
void visit (const te::gm::CompoundCurve &)
 
void visit (const te::gm::CurvePolygon &)
 

Private Attributes

te::common::MachineByteOrder m_byteOrder
 The byte order used to encode the EWKB. More...
 
char * m_ewkb
 A pointer that marks the current position in a buffer to be write when parsing the geometry. More...
 
bool m_outputSRID
 If true we add a bit indicating that the srid will be outputed with the gometry. More...
 

Detailed Description

An utility class for writing a PostGIS EWKB.

Definition at line 48 of file EWKBWriter.h.

Constructor & Destructor Documentation

te::pgis::EWKBWriter::EWKBWriter ( char *  ewkb,
te::common::MachineByteOrder  byteOrder = te::common::NDR 
)

It constructs a new EWKB writer.

Parameters
ewkbA pointer to a buffer to output the ewkb. It must have at least the size in bytes necessary to write the EWKB.
byteOrderThe byte order to be used to encode the WKB.
te::pgis::EWKBWriter::~EWKBWriter ( )

Destructor.

Member Function Documentation

void te::pgis::EWKBWriter::reset ( char *  ewkb,
te::common::MachineByteOrder  byteOrder = te::common::NDR 
)

It resets the EWKB writer an allows a new geometry to be seriealized to a new buffer.

Parameters
ewkbA pointer to a buffer to output the ewkb. It must have at least the size in bytes necessary to write the EWKB.
byteOrderThe byte order to be used to encode the EWKB.
void te::pgis::EWKBWriter::visit ( const te::gm::Curve )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 95 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::Geometry )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 96 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::GeometryCollection visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::LinearRing visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::LineString visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::MultiCurve )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 100 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::MultiLineString visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::MultiPoint visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::MultiPolygon visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::MultiSurface )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 104 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::AbstractPoint )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 105 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::Point visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::PointM visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::PointZ visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::PointZM visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::PointKd )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 110 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::Polygon visited)
protectedvirtual

Implements te::gm::Visitor.

void te::pgis::EWKBWriter::visit ( const te::gm::PolyhedralSurface )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 112 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::Surface )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 113 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::TIN )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 114 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::Triangle )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 115 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::CircularString )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 116 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::CompoundCurve )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 117 of file EWKBWriter.h.

void te::pgis::EWKBWriter::visit ( const te::gm::CurvePolygon )
inlineprotectedvirtual

Implements te::gm::Visitor.

Definition at line 118 of file EWKBWriter.h.

void te::pgis::EWKBWriter::write ( const te::gm::Geometry geom)

It serializes the geometry to an EWKB representation into the specified buffer.

Parameters
geomThe geometry to be serialized.
Note
You must call reset in successive calls to this method.
static void te::pgis::EWKBWriter::write ( const te::gm::Geometry geom,
char *  ewkb,
te::common::MachineByteOrder  byteOrder = te::common::NDR 
)
static

It serializes the geometry to an EWKB representation into the specified buffer.

The ewkb parameter must have at least geom.getWkbSize() + 4 bytes in order to be used. Don't pass a NULL pointer or a buffer smaller than the size needed. Note that the EWKB will be on the specified byte order.

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

Member Data Documentation

te::common::MachineByteOrder te::pgis::EWKBWriter::m_byteOrder
private

The byte order used to encode the EWKB.

Definition at line 123 of file EWKBWriter.h.

char* te::pgis::EWKBWriter::m_ewkb
private

A pointer that marks the current position in a buffer to be write when parsing the geometry.

Definition at line 122 of file EWKBWriter.h.

bool te::pgis::EWKBWriter::m_outputSRID
private

If true we add a bit indicating that the srid will be outputed with the gometry.

Definition at line 124 of file EWKBWriter.h.


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