Index

DKDDO (Dynamic Data Object)

Purpose:

A DDO is a special class of DDOBase that keeps the information about its associated datastore and has add, retrieve, update and delete methods. With the help of the datastore, it can send itself in and out of datastore. A datastore query returns a collection of DKDDO objects.

Heirarchy:

dkDataObjectBase
 dkDataObject
   DKDDOBase
     DKDDO

Class summary:

class dkDatastore;
class DKDDODef;
 
class DKEXPORT DKDDO : public DKDDOBase
{
  public:
    DKDDO(ushort initialSize = DK_DDO_INITIAL_SIZE);
    DKDDO(const char* objectType, ushort initialSize = DK_DDO_INITIAL_SIZE);
    DKDDO(dkDatastore* ds, const char* objectType, ushort initialSize = 
                                                       DK_DDO_INITIAL_SIZE);
    DKDDO(const DKPid& pid, ushort initialSize = DK_DDO_INITIAL_SIZE);
    DKDDO(dkDatastore* ds, const DKPid& pid, ushort initialSize = 
                                                       DK_DDO_INITIAL_SIZE);
    DKDDO(dkDatastore* ds, const DKPid& pid, DKDDODef* ddoDef);
  
    virtual ~DKDDO();
 
    virtual void         setDatastore(dkDatastore* ds);
    virtual dkDatastore* getDatastore() const;
    virtual short        protocol() const;
 
    virtual dkDataObjectBase&  add();
    virtual dkDataObjectBase&  add(long option);
    virtual dkDataObjectBase&  add(const DKNVPair* parms, long arraySize);
    virtual dkDataObjectBase&  retrieve();
    virtual dkDataObjectBase&  retrieve(long option);
    virtual dkDataObjectBase&  retrieve(const DKNVPair* parms, long arraySize);
    virtual dkDataObjectBase&  update();
    virtual dkDataObjectBase&  update(long option);
    virtual dkDataObjectBase&  update(const DKNVPair* parms, long arraySize);
    virtual dkDataObjectBase&  del();
    virtual dkDataObjectBase&  del(long option);
    virtual dkDataObjectBase&  del(const DKNVPair* parms, long arraySize);
};

Exceptions:

DKDDO throws the same exceptions thrown by DKDDOBase.

Members:

Constructor
    DKDDO(ushort initialSize = DK_DDO_INITIAL_SIZE);
    DKDDO(const char* objectType, ushort initialSize = DK_DDO_INITIAL_SIZE);
    DKDDO(dkDatastore* ds, const char* objectType, ushort initialSize = 
                                                       DK_DDO_INITIAL_SIZE);
    DKDDO(const DKPid& pid, ushort initialSize = DK_DDO_INITIAL_SIZE);
    DKDDO(dkDatastore* ds, const DKPid& pid, ushort initialSize = 
                                                       DK_DDO_INITIAL_SIZE);
    DKDDO(dkDatastore* ds, const DKPid& pid, DKDDODef* ddoDef);
  
    virtual ~DKDDO();

A DDO object can be created by calling the constructor with or without supplying any parameter, or by copying information from another DDO.

Member functions

setDatastore
Sets this datastore as the one associated with this DDO; that is, the datastore to keep the persistent copy of this DDO.
virtual void setDatastore (dkDatastore* ds);

getDatastore
     virtual dkDatastore* getDatastore() const;

Gets the associated datastore for this DDO.

protocol
Returns the protocol supported by this object. In this case, it is DK_CM_PDDO, which essentially means that this object knows about the datastore it's associated with, and with the help of the datastore, this object can store itself in and out of the datastore.
virtual short protocol() const;

add/retrieve/update/delete functions
Inserts, retrieves, updates, or deletes this object from the persistent datastore. The add, del, and update operations only affect the object in the persistent datastore. They do not change the copy in main memory.
virtual dkDataObjectBase& add();
    virtual dkDataObjectBase& add(long option);
    virtual dkDataObjectBase& add(const DKNVPair* parms, long arraySize);
    virtual dkDataObjectBase& retrieve();
    virtual dkDataObjectBase& retrieve(long option);
    virtual dkDataObjectBase& retrieve(const DKNVPair* parms, long arraySize);
    virtual dkDataObjectBase& update();
    virtual dkDataObjectBase& update(long option);
    virtual dkDataObjectBase& update(const DKNVPair* parms, long arraySize);
    virtual dkDataObjectBase& del();
    virtual dkDataObjectBase& del(long option);
    virtual dkDataObjectBase& del(const DKNVPair* parms, long arraySize);

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.