OTB
9.0.0
Orfeo Toolbox
|
#include <otbOGRFieldWrapper.h>
Public Member Functions | |
Field (Feature &feature, int index) | |
FieldDefn const & | GetDefinition () const |
OGRFieldType | GetType () const |
std::string | GetName () const |
bool | HasBeenSet () const |
void | Unset () const |
template<typename T > | |
void | SetValue (T const &value) |
template<typename T > | |
T | GetValue () const |
std::ostream & | PrintSelf (std::ostream &os, itk::Indent indent) const |
void | Assign (Field const &f) |
OGRField & | ogr () |
OGRField & | ogr () const |
Unchecked definitions | |
All the definitions that follow do the real work. However, they are not the exposed public functions. The design of this class follows the principle behind the NVI (Non-Virtual Interface) pattern:
| |
FieldDefn | m_Definition |
std::shared_ptr< OGRFeature > & | m_Feature |
int | m_index |
bool | UncheckedHasBeenSet () const |
void | UncheckedUnset () const |
std::ostream & | UncheckedPrintSelf (std::ostream &os, itk::Indent indent) const |
void | UncheckedAssign (Field const &f) |
void | CheckInvariants () const |
Encapsulation of OGRField
Instances of Field
are expected to be built from an existing Feature
with which they'll share their owning OGRFeature
.
A Field
instance works as a proxy. Copying a field will only have it share the actual OGRField
between several instances. In order to copy a field value from another field, use Field::assign()
.
m_Feature
shall be valid (i.e. not wrapping a null OGRFeature
). m_index < m_Feature->GetFieldCount()
. m_Feature->GetFieldDefnRef(m_index) != 0
. Definition at line 117 of file otbOGRFieldWrapper.h.
otb::ogr::Field::Field | ( | Feature & | feature, |
int | index | ||
) |
|
inline |
Copies a field. As Field
is a proxy type, this function is the only possible way to copy a field.
First, the field must be defined with a definition, then it could be set from another field value.
Definition at line 495 of file otbOGRFieldWrapper.hxx.
References CheckInvariants(), and GetType().
|
inlineprivate |
Internal function to check class invariants. If any invariant is broken, an assertion will be fired.
Definition at line 435 of file otbOGRFieldWrapper.hxx.
References m_Feature, and m_index.
Referenced by Assign().
|
inline |
Field definition accessor.
Definition at line 129 of file otbOGRFieldWrapper.h.
|
inline |
Field name accessor.
Definition at line 139 of file otbOGRFieldWrapper.h.
|
inline |
Field type accessor.
Definition at line 134 of file otbOGRFieldWrapper.h.
Referenced by Assign(), and otb::OGRLayerStreamStitchingFilter< TInputImage >::ProcessStreamingLine().
|
inline |
Value getter.
T | expected type for the stored value. |
None |
T
must match the field's type. Definition at line 463 of file otbOGRFieldWrapper.hxx.
Referenced by otb::OGRLayerStreamStitchingFilter< TInputImage >::ProcessStreamingLine(), and otb::PersistentImageToOGRLayerSegmentationFilter< TImageType, TSegmentationFilter >::ProcessTile().
|
inline |
Tells whether the field value has been set.
Definition at line 483 of file otbOGRFieldWrapper.hxx.
|
inline |
Access to the raw underlying OGR data. This function provides an abstraction leak in case deeper control on the underlying OGRFeature
is required.
OGRField
obtained this way. Definition at line 508 of file otbOGRFieldWrapper.hxx.
OGRField& otb::ogr::Field::ogr | ( | ) | const |
Access to the raw underlying OGR data. This function provides an abstraction leak in case deeper control on the underlying OGRFeature
is required.
OGRField
obtained this way.
|
inline |
Prints self into stream.
Definition at line 477 of file otbOGRFieldWrapper.hxx.
|
inline |
Value setter.
[in] | value | New value for the field. |
None |
value's
kind must match the field's type. Definition at line 443 of file otbOGRFieldWrapper.hxx.
Referenced by otb::PersistentImageToOGRLayerSegmentationFilter< TImageType, TSegmentationFilter >::ProcessTile().
|
private |
Definition of the field.
|
private |
Definition of the field.
|
private |
Definition of the field.
|
private |
Definition of the field.
|
inline |
Unsets the value of the field.
Definition at line 489 of file otbOGRFieldWrapper.hxx.
|
private |
Definition of the field.
Definition at line 231 of file otbOGRFieldWrapper.h.
|
private |
Link to the actual OGRFeature
in charge of the fields.
Definition at line 233 of file otbOGRFieldWrapper.h.
Referenced by CheckInvariants().
|
private |
Index of the field according to the feature definition.
Definition at line 240 of file otbOGRFieldWrapper.h.
Referenced by CheckInvariants().