CFx SDK Documentation  2020SP3
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
DbObject.h File Reference
#include "TD_PackPush.h"
#include "Gi/GiDrawable.h"
#include "DbObjectId.h"
#include "OdString.h"
#include "DbObjectReactor.h"
#include "IdArrays.h"
#include "ResBuf.h"
#include "DebugStuff.h"
#include "TD_PackPop.h"

Go to the source code of this file.

Classes

class  OdError_XdataSizeExceeded
 
class  OdDbObject
 

Namespaces

 OdDb
 

Macros

#define _ODDBXOBJECT_INCLUDED_   /*!DOM*/
 
#define ODDB_DECLARE_MEMBERS(ClassName)
 
#define DBOBJECT_CONSTR(ClassName)   OdSmartPtr<ClassName> (new ClassName, kOdRxObjAttach)
 

Typedefs

typedef OdSmartPtr< OdDbXrecordOdDbXrecordPtr
 
typedef OdSmartPtr< OdDbObjectOdDbObjectPtr
 

Enumerations

enum  OdDb::DuplicateRecordCloning {
  OdDb::kDrcNotApplicable = 0, OdDb::kDrcIgnore = 1, OdDb::kDrcReplace = 2, OdDb::kDrcXrefMangleName = 3,
  OdDb::kDrcMangleName = 4, OdDb::kDrcUnmangleName = 5, OdDb::kDrcMax = kDrcUnmangleName
}
 
enum  OdDb::Visibility { OdDb::kInvisible = 1, OdDb::kVisible = 0 }
 
enum  OdDb::SaveType { OdDb::kDwg = 0, OdDb::kDxf = 1, OdDb::kDxb = 2, OdDb::kUnknown = -1 }
 

Functions

TOOLKIT_EXPORT OdResBufPtr oddbEntGet (const OdDbObject *pObj, const OdString &regapps=OdString::kEmpty)
 
OdResBufPtr oddbEntGet (const OdDbObjectId &id, const OdString &regapps=OdString::kEmpty)
 
TOOLKIT_EXPORT OdResult oddbEntMod (OdDbObject *pObj, OdResBuf *pRb)
 
OdResult oddbEntMod (const OdDbObjectId &id, OdResBuf *pRb)
 
TOOLKIT_EXPORT OdDbObjectId oddbEntNext (OdDbObjectId id, OdDbDatabase *db)
 
TOOLKIT_EXPORT OdDbObjectId oddbEntLast (OdDbDatabase *db)
 
TOOLKIT_EXPORT OdResult oddbEntMake (OdDbDatabase *pDb, OdResBuf *pRb, OdDbObjectPtr &pObj)
 
TOOLKIT_EXPORT OdResult oddbEntMakeX (OdDbDatabase *pDb, OdResBuf *pRb, OdDbObjectPtr &pObj)
 

Macro Definition Documentation

◆ _ODDBXOBJECT_INCLUDED_

#define _ODDBXOBJECT_INCLUDED_   /*!DOM*/

Definition at line 28 of file DbObject.h.

◆ DBOBJECT_CONSTR

#define DBOBJECT_CONSTR (   ClassName)    OdSmartPtr<ClassName> (new ClassName, kOdRxObjAttach)

Creates a new instance of a derived class, and returns a SmartPointer to it, without incrementing the reference count of the new object.

Parameters
ClassName[in] Name of the derived class.

Definition at line 94 of file DbObject.h.

◆ ODDB_DECLARE_MEMBERS

#define ODDB_DECLARE_MEMBERS (   ClassName)
Value:
protected: \
ClassName(OdDbObjectImpl* pImpl); \
public: \
ODRX_DECLARE_MEMBERS (ClassName)

Declares the member functions for classes derived from OdDbObject.

Parameters
ClassName[in] Name of the derived class.
Remarks
Classes derived from OdDbObject should invoke this macro in their class definitions, passing the name of the derived class.

Definition at line 80 of file DbObject.h.

Typedef Documentation

◆ OdDbObjectPtr

This template class is a specialization of the OdSmartPtr class for all objects contained in the database.

See also
<link smart_pointers.html, Working with Smart Pointers>

Definition at line 1732 of file DbObject.h.

◆ OdDbXrecordPtr

This template class is a specialization of the OdSmartPtr class for OdDbXrecord object pointers.

See also
<link smart_pointers.html, Working with Smart Pointers>

Definition at line 68 of file DbObject.h.

Function Documentation

◆ oddbEntGet() [1/2]

TOOLKIT_EXPORT OdResBufPtr oddbEntGet ( const OdDbObject pObj,
const OdString regapps = OdString::kEmpty 
)

Returns the data for the specified object.

Parameters
id[in] Object ID of the object.
pObj[in] Pointer to the object.
regapps[in] Registered application name to retrieve extended data for. May be a wildcard or comma separated list. If empty - no XData is returned.
Remarks
Each OdResBuf in the list contains a single DXF group code and data value pertaining to the object.

The object is opened in kForRead mode, and the returned list of data is independent of the original object (it may be modified or deleted without affecting the original object). To affect changes in the original object via the returned OdResBuf data, oddbEntMod must be called.

throws: An OdError exception will be thrown if the passed in object cannot be opened.

◆ oddbEntGet() [2/2]

OdResBufPtr oddbEntGet ( const OdDbObjectId id,
const OdString regapps = OdString::kEmpty 
)
inline

Definition at line 1757 of file DbObject.h.

◆ oddbEntLast()

TOOLKIT_EXPORT OdDbObjectId oddbEntLast ( OdDbDatabase db)

◆ oddbEntMake()

TOOLKIT_EXPORT OdResult oddbEntMake ( OdDbDatabase pDb,
OdResBuf pRb,
OdDbObjectPtr pObj 
)

◆ oddbEntMakeX()

TOOLKIT_EXPORT OdResult oddbEntMakeX ( OdDbDatabase pDb,
OdResBuf pRb,
OdDbObjectPtr pObj 
)

◆ oddbEntMod() [1/2]

OdResult oddbEntMod ( const OdDbObjectId id,
OdResBuf pRb 
)
inline

Definition at line 1779 of file DbObject.h.

◆ oddbEntMod() [2/2]

TOOLKIT_EXPORT OdResult oddbEntMod ( OdDbObject pObj,
OdResBuf pRb 
)

Sets the data for the specified object.

Parameters
id[in] Object ID of the object.
pObj[in] Pointer to the object.
Remarks
Each OdResBuf in the list contains a single DXF group code and data value pertaining to the object.

throws: An OdError exception will be thrown if the passed in object cannot be opened in kForWrite mode.

◆ oddbEntNext()

TOOLKIT_EXPORT OdDbObjectId oddbEntNext ( OdDbObjectId  id,
OdDbDatabase db 
)