Close

Relief for ODA Team in Ukraine

Learn more
ODA Drawings SDK
OdDbObject Class
Syntax
C++
class OdDbObject : public OdGiDrawable;

This class is the base class for all objects contained in an OdDbDatabase instance (OdDb objects).

Creating and Deleting Database Objects 

 

  • Database objects are normally created by calling OdDbXXXXX::createObject(). When an object is created, it will be in kOpenForWrite mode. The delete operator should never be called on database objects. Instead, erase() should be called, which marks the object as erased.
  • OdDbObject instances should be created by calling the createObject() method.
  • OdDbObject instances are created in kOpenForWrite mode.
  • Depending on other OdDbObject instances while constructing or deleting instances is prohibited.
  • OdDbObject instances should be deleted from an OdDbDatabase with erase().
  • Never access a pointer to a closed object.
  • The delete operator must never be called on OdDbObject instances. Instead, the erase() method should be called, which marks this object as erased.

 

Accessing Database Objects 

 

  • Database objects must be opened before they can be accessed.
  • Given a valid OdDbObjectId, a database object is opened by calling OdDbObjectId::safeOpenObject().
  • Database objects should be opened in the most restrictive mode possible, and should be released immediately when access is no longer needed.

 

Object may be opened in any one of the following modes: 

 

Mode
Description
OdDb::kForRead
Allows operations that do not modify this object.
A database object can be opened in this mode any number of times (simultaneously),
if has not open in OdDb::kForWrite or OdDb::kForNotify mode.
An exception will be thrown if any type of write operation is attempted
on an object open in this mode.
OdDb::kForWrite
Allows read and write operations to be performed on this object.
An database object can be opened in this mode only if it is not
already open in any mode.
OdDb::kForNotify
This object is opened for notification purposes.
A database object can be opened in this mode so long as it is
not already open in kNotify mode.
OdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObject

File: DbObject.h 

Module: API Reference 

  • OdDbObjectId
  • OdDbDatabase

 

Corresponding C++ library: TD_Db 

 

Copyright © 2002-2022. Open Design Alliance All rights reserved.