NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
gdb_feature_edit.h
Go to the documentation of this file.
1 #ifndef SDK_GDB_FEATURE_EDIT_INTERFACE_H_
10 #define SDK_GDB_FEATURE_EDIT_INTERFACE_H_
11 #pragma once
12 
13 #include <base/inc/base_types.h>
14 #include <base/inc/interfaces/edit/edit_interface.h>
18 
19 SDK_GDB_BEGIN_NAMESPACE
20 
21 // Classes declared in this file.
25 
26 
30 public:
31 
37  virtual GDBResult SDK_CALLTYPE SetAttributeValue(
38  AttributeClassCode class_code,
39  const SDKAny& value) throw() = 0;
40 
45  virtual GDBResult SDK_CALLTYPE DeleteAttribute(
46  AttributeClassCode class_code) throw() = 0;
47 
48  SDK_IMPLEMENT_IID(IAttributeCollectionEdit)
49  SDK_END_INTERFACE(IAttributeCollectionEdit)
50 };
51 SDK_DECLARE_IID(IAttributeCollectionEdit)
52 
53 class IObjectEdit : public ISDKEdit {
58 public:
64  virtual GDBResult SDK_CALLTYPE SetObjectClassCode(
65  ClassCode code) throw() = 0;
66 
72  virtual GDBResult SDK_CALLTYPE SetAttributes(
73  IAttributeCollection* attributes) throw() = 0;
74 
80  virtual GDBResult SDK_CALLTYPE SetFlags(SDKUInt64 flags) throw() = 0;
81 
90  virtual GDBResult SDK_CALLTYPE AddRelationship(
91  ObjectID member,
92  RelationshipClass relationship_class,
93  RelationshipRole role,
94  ObjectID& rel_id) throw() = 0;
95 
102  virtual GDBResult SDK_CALLTYPE GetAttributesEditor(
103  IAttributeCollectionEdit** attributes_editor) throw() = 0;
104 
105  SDK_IMPLEMENT_IID(IObjectEdit)
106  SDK_END_INTERFACE(IObjectEdit)
107 };
108 SDK_DECLARE_IID(IObjectEdit)
109 
110 class IFeatureEdit : public IObjectEdit {
114 public:
116  enum Properties {
118  };
119 
121  enum Flags {
123  };
124 
130  virtual GDBResult SDK_CALLTYPE SetFOID(const SDKAny& foid) throw() = 0;
131 
137  virtual GDBResult SDK_CALLTYPE SetShape(
138  sdk::geometry::IGeometry* geometry) throw() = 0;
139 
146  virtual GDBResult SDK_CALLTYPE AddSlave(
147  IFeatureEdit** slave_feature) throw() = 0;
148 
155  virtual GDBResult SDK_CALLTYPE DeleteSlave(
156  IFeature* slave_feature) throw() = 0;
157 
163  virtual GDBResult SDK_CALLTYPE GetGeometryEditor(
164  sdk::geometry::IGeometryEdit** geometry_edit) throw() = 0;
165 
166  template< typename T >
167  GDBResult SetAttributeValueT(AttributeClassCode class_code,
168  T value) noexcept {
169  IAttributeCollectionEditSP attributes_editor;
170  GDBResult res = GetAttributesEditor(&attributes_editor);
171  if (SDK_FAILED(res))
172  return res;
173  return attributes_editor->SetAttributeValue(class_code, ScopedAny(value));
174  }
175 
176  inline GDBResult SetAttributeValueTime(AttributeClassCode class_code,
177  SDKTime value) noexcept {
178  IAttributeCollectionEditSP attributes_editor;
179  GDBResult res = GetAttributesEditor(&attributes_editor);
180  if (SDK_FAILED(res))
181  return res;
182  return attributes_editor->SetAttributeValue(class_code,
183  ScopedAny(value, true));
184  }
185 
186  inline GDBResult SetAttributeValueInl(AttributeClassCode class_code,
187  const ScopedAny& value) noexcept {
188  IAttributeCollectionEditSP attributes_editor;
189  GDBResult res = GetAttributesEditor(&attributes_editor);
190  if (SDK_FAILED(res))
191  return res;
192  return attributes_editor->SetAttributeValue(class_code, value);
193  }
194 
195  SDK_IMPLEMENT_IID(IFeatureEdit)
196  SDK_END_INTERFACE(IFeatureEdit)
197 };
198 SDK_DECLARE_IID(IFeatureEdit)
199 
200 SDK_GDB_END_NAMESPACE
201 
202 #endif // SDK_GDB_FEATURE_EDIT_INTERFACE_H_
IFeatureEdit::Flags
Flags
Feature editor property Flags.
Definition: gdb_feature_edit.h:121
IFeatureEdit::Properties
Properties
Feature editor properties.
Definition: gdb_feature_edit.h:116
IFeatureEdit::SetFOID
virtual GDBResult SDK_CALLTYPE SetFOID(const SDKAny &foid)=0
Sets a feature unique identifier to the feature object.
RelationshipRole
RelationshipRole
Definition of the Relation role.
Definition: gdb_const.h:305
IAttributeCollectionEdit
Specifies an interface for a GDB Geometry object.
Definition: gdb_feature_edit.h:29
IAttributeCollectionEdit::SetAttributeValue
virtual GDBResult SDK_CALLTYPE SetAttributeValue(AttributeClassCode class_code, const SDKAny &value)=0
Sets a value of the attribute.
base_types.h
SDK base types.
IObjectEdit::SetObjectClassCode
virtual GDBResult SDK_CALLTYPE SetObjectClassCode(ClassCode code)=0
Sets an object class code.
IFeatureEdit::GetGeometryEditor
virtual GDBResult SDK_CALLTYPE GetGeometryEditor(sdk::geometry::IGeometryEdit **geometry_edit)=0
Returns the geometry editor associated with this feature.
IObjectEdit
Object is a basic entity of a geodatabase dataset. Every object in the geodatabase is uniquely identi...
Definition: gdb_feature_edit.h:57
geometry_edit.h
Describes interfaces for editing of geometry objects.
IFeatureEdit::kIFE_Flags
@ kIFE_Flags
Propertiy Flags to control the feature editor operations.
Definition: gdb_feature_edit.h:117
IFeatureEdit::DeleteSlave
virtual GDBResult SDK_CALLTYPE DeleteSlave(IFeature *slave_feature)=0
Breaks off master-slave relation between 2 features. This method was introduced for performance reaso...
IFeatureEdit::SetShape
virtual GDBResult SDK_CALLTYPE SetShape(sdk::geometry::IGeometry *geometry)=0
Sets a geometry associated with this feature.
sdk::geometry::IGeometryEdit
Provides access to members that describe properties and behavior of all geometric objects.
Definition: geometry_edit.h:26
IFeatureEdit::AddSlave
virtual GDBResult SDK_CALLTYPE AddSlave(IFeatureEdit **slave_feature)=0
Creates a new feature and adds it as a slave to the master one. This method was introduced for perfor...
IAttributeCollection
Provides access to members that can be used to access the individual attributes of a geometry,...
Definition: gdb_attribute.h:76
IAttributeCollectionEdit::DeleteAttribute
virtual GDBResult SDK_CALLTYPE DeleteAttribute(AttributeClassCode class_code)=0
Deletes the attribute with specified class code.
IFeatureEdit::kForceKeepHistory
@ kForceKeepHistory
This flag enforces the feature editor to save history after editing.
Definition: gdb_feature_edit.h:122
gdb_const.h
Geo database constants and structures.
ClassCode
SDKUInt32 ClassCode
Definition of the ClassCode types.
Definition: gdb_const.h:229
sdk::ScopedAny
sdk::SDKAnyHandler ScopedAny
Synonym for the SDKAnyHandler.
Definition: sdk_any_handler.h:569
IFeature
Feature is a spatial object. A feature has an associated shape. A feature may have a shape with more ...
Definition: gdb_feature.h:187
IObjectEdit::SetFlags
virtual GDBResult SDK_CALLTYPE SetFlags(SDKUInt64 flags)=0
Sets object flags.
IFeatureEdit
Feature is a spatial object. A feature has an associated shape. A feature may have a shape with more ...
Definition: gdb_feature_edit.h:113
SDK_FAILED
#define SDK_FAILED(res)
Checks failed result.
Definition: sdk_results_enum.h:69
ObjectID
Object identifier.
Definition: gdb_const.h:115
IObjectEdit::GetAttributesEditor
virtual GDBResult SDK_CALLTYPE GetAttributesEditor(IAttributeCollectionEdit **attributes_editor)=0
Returns the attributes editor.
ISDKComponent
Base interface for all SDK interfaces.
Definition: sdk_component_interface.h:41
IObjectEdit::SetAttributes
virtual GDBResult SDK_CALLTYPE SetAttributes(IAttributeCollection *attributes)=0
Adds (copies) specified attributes from a collection to the object.
AttributeClassCode
ClassCode AttributeClassCode
Attribute class code type.
Definition: gdb_const.h:247
RelationshipClass
RelationshipClass
Definition of the Relationship class.
Definition: gdb_const.h:313
SDKTime
SDK_END_NAMESPACE typedef SDKInt64 SDKTime
Milliseconds from Unix epoch.
Definition: base_types.h:56
gdb_feature.h
Describes interfaces that manages a geodatabase feature object.
IObjectEdit::AddRelationship
virtual GDBResult SDK_CALLTYPE AddRelationship(ObjectID member, RelationshipClass relationship_class, RelationshipRole role, ObjectID &rel_id)=0
Adds a relationship between two existing objects in the dataset.
FWD_DECL_INTERFACE
FWD_DECL_INTERFACE(ILWEParserWrapper)
Provides a wrapper around the message parser to get, add or remove the.