CFx SDK Documentation  2022 SP0
Public Types | Public Member Functions | List of all members
OdDbLongTransaction Class Reference

#include <DbLongTransaction.h>

Inheritance diagram for OdDbLongTransaction:
OdDbObject OdGiDrawable OdRxObject

Public Types

enum  { kSameDb = 0 , kXrefDb = 1 , kUnrelatedDb = 2 }
 
- Public Types inherited from OdGiDrawable
enum  SetAttributesFlags {
  kDrawableNone = 0 , kDrawableIsAnEntity = 1 , kDrawableUsesNesting = 2 , kDrawableIsCompoundObject = 4 ,
  kDrawableViewIndependentViewportDraw = 8 , kDrawableIsInvisible = 16 , kDrawableHasAttributes = 32 , kDrawableRegenTypeDependantGeometry = 64 ,
  kDrawableIsDimension = (kDrawableIsAnEntity + kDrawableIsCompoundObject + 128) , kDrawableRegenDraw = 256 , kDrawableStandardDisplaySingleLOD = 512 , kDrawableShadedDisplaySingleLOD = 1024 ,
  kDrawableViewDependentViewportDraw = 2048 , kDrawableBlockDependentViewportDraw = 4096 , kDrawableIsExternalReference = 8192 , kDrawableNotPlottable = 16384 ,
  kLastFlag = kDrawableNotPlottable
}
 
enum  DrawableType {
  kGeometry = 0 , kDistantLight = 1 , kPointLight = 2 , kSpotLight = 3 ,
  kAmbientLight , kSolidBackground , kGradientBackground , kImageBackground ,
  kGroundPlaneBackground , kViewport , kWebLight , kSkyBackground ,
  kImageBasedLightingBackground
}
 

Public Member Functions

 ODDB_DECLARE_MEMBERS (OdDbLongTransaction)
 
 OdDbLongTransaction ()
 
int type () const
 
OdDbObjectId originBlock () const
 
OdDbObjectId destinationBlock () const
 
OdString getLongTransactionName () const
 
OdResult addToWorkSet (OdDbObjectId ObjectId)
 
OdResult removeFromWorkSet (OdDbObjectId id)
 
OdResult syncWorkSet ()
 
OdDbLongTransWorkSetIteratorPtr newWorkSetIterator (bool incRemovedObjs=false, bool incSecondaryObjs=false) const
 
OdDbObjectId originObject (OdDbObjectId workSetId) const
 
bool workSetHas (OdDbObjectId ObjectId, bool getErased=false) const
 
OdDbIdMappingactiveIdMap ()
 
void applyPartialUndo (OdDbDwgFiler *pUndoFiler, OdRxClass *pClassObj)
 
virtual OdResult dwgInFields (OdDbDwgFiler *pFiler)
 
virtual void dwgOutFields (OdDbDwgFiler *pFiler) const
 
virtual OdResult subErase (bool erasing)
 
- Public Member Functions inherited from OdDbObject
 ODDB_DECLARE_MEMBERS (OdDbObject)
 
 ~OdDbObject ()
 
void addRef ()
 
void release ()
 
long numRefs () const
 
OdDbObjectId objectId () const
 
OdDbHandle getDbHandle () const
 
OdDbHandle handle () const
 
OdDbObjectId ownerId () const
 
virtual void setOwnerId (OdDbObjectId ownerId)
 
OdDbDatabasedatabase () const
 
void createExtensionDictionary ()
 
OdDbObjectId extensionDictionary () const
 
bool releaseExtensionDictionary ()
 
OdDbXrecordPtr createXrecord (const OdString &xrecordName, OdDb::DuplicateRecordCloning style=OdDb::kDrcIgnore)
 
void upgradeOpen ()
 
void downgradeOpen ()
 
void cancel ()
 
virtual OdResult subOpen (OdDb::OpenMode mode)
 
virtual void subClose ()
 
OdResult erase (bool eraseIt=true)
 
void handOverTo (OdDbObject *pNewObject, bool keepXData=true, bool keepExtDict=true)
 
virtual void subHandOverTo (OdDbObject *pNewObject)
 
void swapIdWith (OdDbObjectId otherId, bool swapXdata=false, bool swapExtDict=false)
 
virtual void subSwapIdWith (const OdDbObjectId &otherId, bool swapXdata=false, bool swapExtDict=false)
 
virtual void audit (OdDbAuditInfo *pAuditInfo)
 
void dwgIn (OdDbDwgFiler *pFiler)
 
void dwgOut (OdDbDwgFiler *pFiler) const
 
virtual OdResult dxfIn (OdDbDxfFiler *pFiler)
 
virtual void dxfOut (OdDbDxfFiler *pFiler) const
 
virtual OdResult dxfInFields (OdDbDxfFiler *pFiler)
 
virtual void dxfOutFields (OdDbDxfFiler *pFiler) const
 
virtual OdResult dxfInFields_R12 (OdDbDxfFiler *pFiler)
 
virtual void dxfOutFields_R12 (OdDbDxfFiler *pFiler) const
 
virtual OdDb::DuplicateRecordCloning mergeStyle () const
 
virtual OdResBufPtr xData (const OdString &regappName=OdString::kEmpty) const
 
virtual void setXData (const OdResBuf *pRb)
 
bool isEraseStatusToggled () const
 
bool isErased () const
 
bool isReadEnabled () const
 
bool isWriteEnabled () const
 
bool isNotifyEnabled () const
 
bool isModified () const
 
bool isModifiedXData () const
 
bool isModifiedGraphics () const
 
bool isNewObject () const
 
bool isNotifying () const
 
bool isUndoing () const
 
bool isReallyClosing () const
 
bool isDBRO () const
 
void assertReadEnabled () const
 
void assertWriteEnabled (bool autoUndo=true, bool recordModified=true)
 
void assertNotifyEnabled () const
 
void disableUndoRecording (bool disable)
 
bool isUndoRecordingDisabled () const
 
OdDbDwgFilerundoFiler ()
 
void addReactor (OdDbObjectReactor *pReactor) const
 
void removeReactor (OdDbObjectReactor *pReactor) const
 
virtual void addPersistentReactor (const OdDbObjectId &objId)
 
virtual void removePersistentReactor (const OdDbObjectId &objId)
 
bool hasPersistentReactor (const OdDbObjectId &objId) const
 
OdDbObjectIdArray getPersistentReactors () const
 
OdDbObjectReactorArray getTransientReactors () const
 
virtual void recvPropagateModify (const OdDbObject *pSubObj)
 
virtual void xmitPropagateModify () const
 
ODRX_SEALED_VIRTUAL OdDbObjectPtr deepClone (OdDbIdMapping &ownerIdMap, OdDbObject *pOwner, bool bPrimary=true) const ODRX_SEALED
 
ODRX_SEALED_VIRTUAL OdDbObjectPtr wblockClone (OdDbIdMapping &ownerIdMap, OdDbObject *pOwner, bool bPrimary=true) const ODRX_SEALED
 
virtual void appendToOwner (OdDbIdPair &idPair, OdDbObject *pOwnerObject, OdDbIdMapping &ownerIdMap)
 
void setOdDbObjectIdsInFlux ()
 
bool isOdDbObjectIdsInFlux () const
 
virtual void copied (const OdDbObject *pObject, const OdDbObject *pNewObject)
 
virtual void erased (const OdDbObject *pObject, bool erasing=true)
 
virtual void goodbye (const OdDbObject *pObject)
 
virtual void openedForModify (const OdDbObject *pObject)
 
virtual void modified (const OdDbObject *pObject)
 
virtual void subObjModified (const OdDbObject *pObject, const OdDbObject *pSubObj)
 
virtual void modifyUndone (const OdDbObject *pObject)
 
virtual void modifiedXData (const OdDbObject *pObject)
 
virtual void unappended (const OdDbObject *pObject)
 
virtual void reappended (const OdDbObject *pObject)
 
bool isAProxy () const
 
virtual void objectClosed (const OdDbObjectId &objectId)
 
virtual void modifiedGraphics (const OdDbObject *pObject)
 
virtual void copyFrom (const OdRxObject *pSource)
 
bool hasSaveVersionOverride () const
 
void setHasSaveVersionOverride (bool hasSaveVersionOverride)
 
virtual OdDb::DwgVersion getObjectSaveVersion (const OdDbFiler *pFiler, OdDb::MaintReleaseVer *pMaintVer=0) const
 
virtual OdDbObjectPtr decomposeForSave (OdDb::DwgVersion ver, OdDbObjectId &replaceId, bool &exchangeXData)
 
virtual OdDbObjectPtr decomposeForSave (OdDb::SaveType format, OdDb::DwgVersion ver, OdDbObjectId &replaceId, bool &exchangeXData)
 
void convertForSave (OdDb::DwgVersion ver)
 
virtual void composeForLoad (OdDb::SaveType format, OdDb::DwgVersion version, OdDbAuditInfo *pAuditInfo)
 
virtual OdGiDrawabledrawable ()
 
virtual OdUInt32 subSetAttributes (OdGiDrawableTraits *pTraits) const
 
virtual bool subWorldDraw (OdGiWorldDraw *pWd) const
 
virtual void subViewportDraw (OdGiViewportDraw *pVd) const
 
virtual bool isPersistent () const
 
virtual OdDbStub * id () const
 
ODRX_SEALED_VIRTUAL OdResult getClassID (void *pClsid) const ODRX_SEALED
 
void setGsNode (OdGsCache *pNode)
 
OdGsCachegsNode () const
 
void xDataTransformBy (const OdGeMatrix3d &xfm)
 
bool hasFields () const
 
OdDbObjectId getField (const OdString &fieldName) const
 
OdDbObjectPtr getField (const OdString &fieldName, OdDb::OpenMode mode) const
 
virtual OdDbObjectId setField (const OdString &fieldName, OdDbField *pField)
 
virtual OdResult removeField (OdDbObjectId fieldId)
 
virtual OdDbObjectId removeField (const OdString &fieldName)
 
OdDbObjectId getFieldDictionary () const
 
OdDbObjectPtr getFieldDictionary (OdDb::OpenMode mode) const
 
virtual OdRxClasssaveAsClass (OdRxClass *pClass) const
 
- Public Member Functions inherited from OdGiDrawable
 ODRX_DECLARE_MEMBERS (OdGiDrawable)
 
virtual DrawableType drawableType () const
 
ODRX_SEALED_VIRTUAL OdUInt32 setAttributes (OdGiDrawableTraits *pTraits) const ODRX_SEALED
 
ODRX_SEALED_VIRTUAL bool worldDraw (OdGiWorldDraw *pWd) const ODRX_SEALED
 
ODRX_SEALED_VIRTUAL void viewportDraw (OdGiViewportDraw *pVd) const ODRX_SEALED
 
ODRX_SEALED_VIRTUAL OdUInt32 viewportDrawLogicalFlags (OdGiViewportDraw *pVd) const ODRX_SEALED
 
virtual OdResult getGeomExtents (OdGeExtents3d &extents) const
 
ODRX_SEALED_VIRTUAL OdUInt32 regenSupportFlags () const ODRX_SEALED
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Additional Inherited Members

- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 
- Protected Member Functions inherited from OdDbObject
 OdDbObject ()
 
virtual OdResult subGetClassID (void *pClsid) const
 
virtual OdDbObjectPtr subDeepClone (OdDbIdMapping &ownerIdMap, OdDbObject *pOwner, bool bPrimary) const
 
virtual OdDbObjectPtr subWblockClone (OdDbIdMapping &ownerIdMap, OdDbObject *pOwner, bool bPrimary) const
 
- Protected Member Functions inherited from OdGiDrawable
 OdGiDrawable ()
 
virtual OdUInt32 subViewportDrawLogicalFlags (OdGiViewportDraw *vd) const
 
virtual OdUInt32 subRegenSupportFlags () const
 
- Protected Attributes inherited from OdDbObject
OdDbObjectImplm_pImpl
 

Detailed Description

This class implements the tracking of long transactions.

Remarks
This class creates and appends OdcDbLongTransaction objects to the database and and returns the object ID of the OdDbLongTransaction object. Destruction of the OdDbLongTransaction object is handled by the database.

<group OdDb_Classes>

Definition at line 115 of file DbLongTransaction.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kSameDb 
kXrefDb 
kUnrelatedDb 

Definition at line 122 of file DbLongTransaction.h.

Constructor & Destructor Documentation

◆ OdDbLongTransaction()

OdDbLongTransaction::OdDbLongTransaction ( )

Member Function Documentation

◆ activeIdMap()

OdDbIdMapping* OdDbLongTransaction::activeIdMap ( )

Returns a pointer to the OdDbMapping object used for OdLongTransationReactor callbacks used for checkin/checkout.

◆ addToWorkSet()

OdResult OdDbLongTransaction::addToWorkSet ( OdDbObjectId  ObjectId)

Adds the specified object to the current work set.

Parameters
objectId[in] Object ID to be added.
Returns
Returns eOk if successful, or an appropriate error code if not.

objectId must be in the same database as the the transaction.

objectId can specify objects from either the origin block or destination block. Objects from the destination block will be cloned; objects from the origin block will not.

◆ applyPartialUndo()

void OdDbLongTransaction::applyPartialUndo ( OdDbDwgFiler pUndoFiler,
OdRxClass pClassObj 
)
virtual

Notification function called each time an Undo operation is performed this object is using partial Undo.

Parameters
pUndoFiler[in] A pointer to the undo filer with the partial undo information.
pClassObj[in] A pointer to the OdRxClass object for the class that will handle the Undo.
Remarks
An object indicates it's using the partial undo mechanism, if and only if it has set autoUndo false in all calls to assertWriteEnabled().

This member function must know which types of fields to scan, and must stop after reading what it it needs.

If the class type specified by pClassObj does not matches the class of this object, this member function must call the parent class's applyPartialUndo() and return whatever it returns.

If it does match the class of this object, this member function must use pUndoFiler to read the undo data, then typically use this object's set() method.

Throws:

Cause eNotThatKindOfClass pClassObj != OdDbObject::desc()

Reimplemented from OdDbObject.

◆ destinationBlock()

OdDbObjectId OdDbLongTransaction::destinationBlock ( ) const

Returns the object ID of the block to which the entities are cloned.

◆ dwgInFields()

virtual OdResult OdDbLongTransaction::dwgInFields ( OdDbDwgFiler pFiler)
virtual

Reads the .dwg file data of this object.

Parameters
pFiler[in] Filer object from which data are read.
Returns
Returns the filer status.

This function is called by dwgIn() to allow the object to read its data.

When overriding this function:

1) Call assertWriteEnabled(). 2) Call the parent class's dwgInFields(pFiler). 3) If it returns eOK, continue; otherwise return whatever the parent's dwgInFields(pFiler) returned. 4) Call the OdDbDwgFiler(pFiler) methods to read each of the object's data items in the order they were written. 5) Return pFiler->filerStatus().

Reimplemented from OdDbObject.

◆ dwgOutFields()

virtual void OdDbLongTransaction::dwgOutFields ( OdDbDwgFiler pFiler) const
virtual

Writes the .dwg file data of this object.

Parameters
pFiler[in] Pointer to the filer to which data are written.
Remarks

This function is called by dwgIn() to allow the object to write its data.

When overriding this function:

1) Call assertReadEnabled(). 2) Call the parent class's dwgOutFields(pFiler). 3) Call the OdDbDwgFiler(pFiler) methods to write each of the object's data items in the order they were written.

Reimplemented from OdDbObject.

◆ getLongTransactionName()

OdString OdDbLongTransaction::getLongTransactionName ( ) const

Returns the long transaction name.

Returns
Returns the name of the origin block or layout.

◆ newWorkSetIterator()

OdDbLongTransWorkSetIteratorPtr OdDbLongTransaction::newWorkSetIterator ( bool  incRemovedObjs = false,
bool  incSecondaryObjs = false 
) const

Creates an Iterator object that provides access to the entities in the work set.

Parameters
incRemovedObjs[in] True to include removed and erased objects from the work set.
incSecondaryObj[in] True to include objects referenced by objects in the work set.

◆ ODDB_DECLARE_MEMBERS()

OdDbLongTransaction::ODDB_DECLARE_MEMBERS ( OdDbLongTransaction  )

◆ originBlock()

OdDbObjectId OdDbLongTransaction::originBlock ( ) const

Returns the object ID of the block from which the entities are cloned.

◆ originObject()

OdDbObjectId OdDbLongTransaction::originObject ( OdDbObjectId  workSetId) const

Returns the object ID from which the workSetId was cloned.

Parameters
workSetId[in] Work set object ID..

◆ removeFromWorkSet()

OdResult OdDbLongTransaction::removeFromWorkSet ( OdDbObjectId  id)

Removes the specified object from the current work set.

Parameters
objectId[in] Object ID to be removed.
Returns
Returns eOk if successful, or an appropriate error code if not.

◆ subErase()

virtual OdResult OdDbLongTransaction::subErase ( bool  erasing)
virtual

Called as the first operation as this object is being erased or unerased.

Parameters
erasing[in] A copy of the erasing argument passed to erase().
Remarks
This function is notified just before the current object is to be erased, giving this function the ability to cancel the erase.

Returns eOk if and only if erase() is to continue.

When overriding this function:

1) If the OdDbObject's state is incorrect, return something other than eOk.

2) If the parent class's subErase() returns anything other than eOk, immediately return it.

3) If other actions are required before erase, do them.

4) Return eOk.

If you must make changes to this object's state, either make them after step 2, or roll them back if step 2 returns other than eOk.

The default implementation of this function does nothing but return eOk. This function can be overridden in custom classes.

Reimplemented from OdDbObject.

◆ syncWorkSet()

OdResult OdDbLongTransaction::syncWorkSet ( )

Synchronizes work set.

Remarks
removeFromWorkSet() does not remove from the work set objects referenced by removed objects. syncWorkSet() removes them.

◆ type()

int OdDbLongTransaction::type ( ) const

Returns the type of the pending long transaction:

Remarks
type will return one of the following

Value Description kSameDb 0 Entities are checked out from a normal block or layout in the current database. kXrefDb 1 Entities are checked out from ModelSpace or an Xref dependent block in an Xref database. kUnrelatedDb 2 Entities are checked out from ModelSpace or a block in an unrelated database.

◆ workSetHas()

bool OdDbLongTransaction::workSetHas ( OdDbObjectId  ObjectId,
bool  getErased = false 
) const

Returns true if and only if the specified object ID is in the work set.

Parameters
objectId[in] Object ID being tested.
getErased[in] True to return true for erased and removed objects in the work set.

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