Back to index

im-sdk  12.3.91
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends
IMObjectMgr Class Reference

#include <IMBasicObject.hh>

Collaboration diagram for IMObjectMgr:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool add (IMObject *pobj, CARD32BIT &id)
IMObjectget_object_from_fullid (CARD32BIT id)
IMObjectget_object_from_attribid (CARD16BIT id)

Static Public Member Functions

static IMObjectMgrget_instance ()
static IMObjectMgrconstruct ()

Private Types

typedef map< CARD16BIT,
IMObject * > 
IMObjectMap

Private Member Functions

CARD16BIT get_attribid (CARD32BIT fullid)
 IMObjectMgr ()

Private Attributes

int attribid_counter
IMSyncObject sync_object
IMObjectMap objmap

Static Private Attributes

static IMObjectMgrpimobjmgr = NULL

Friends

class IMObject

Detailed Description

Definition at line 281 of file IMBasicObject.hh.


Member Typedef Documentation

typedef map<CARD16BIT, IMObject*> IMObjectMgr::IMObjectMap [private]

Definition at line 286 of file IMBasicObject.hh.


Constructor & Destructor Documentation

IMObjectMgr::IMObjectMgr ( ) [private]

Definition at line 284 of file IMBasicObject.cpp.

Here is the caller graph for this function:


Member Function Documentation

bool IMObjectMgr::add ( IMObject pobj,
CARD32BIT id 
)

Definition at line 297 of file IMBasicObject.cpp.

{
    IMLock lock(sync_object);
    CARD32BIT aid;
#if 0
    if (pobj->downloadablep()) aid = attribid_counter++;
    else aid = id_counter++;
#else
    aid = attribid_counter++;
#endif
    if (aid > attribid_id_max) {
       LOG_CRITICAL("Maximum attribid is exceeded!!!.\n"
                   "We cannot continue operation any longer.");
       // TODO
       // we should throw exeption...
       exit(255);
    }
    if (pobj->downloadablep()) aid = aid | (1 << 15);
    id = (pobj->get_type() << 16) | aid;
    objmap[aid] = pobj;
    return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 290 of file IMBasicObject.cpp.

{
    pimobjmgr = new IMObjectMgr();
    return pimobjmgr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

CARD16BIT IMObjectMgr::get_attribid ( CARD32BIT  fullid) [private]

Definition at line 276 of file IMBasicObject.cpp.

{
    return (id & ((1 << 16) - 1));
}

Here is the caller graph for this function:

static IMObjectMgr* IMObjectMgr::get_instance ( ) [inline, static]

Definition at line 293 of file IMBasicObject.hh.

    { return pimobjmgr; }

Here is the caller graph for this function:

Definition at line 332 of file IMBasicObject.cpp.

{
    IMLock lock(sync_object);
    IMObjectMap::iterator it = objmap.find(id);
    if (it == objmap.end()) return NULL;
    return it->second;
}

Here is the caller graph for this function:

Definition at line 324 of file IMBasicObject.cpp.

Here is the call graph for this function:


Friends And Related Function Documentation

friend class IMObject [friend]

Definition at line 307 of file IMBasicObject.hh.


Member Data Documentation

Definition at line 283 of file IMBasicObject.hh.

Definition at line 287 of file IMBasicObject.hh.

IMObjectMgr * IMObjectMgr::pimobjmgr = NULL [static, private]

Definition at line 284 of file IMBasicObject.hh.

Definition at line 285 of file IMBasicObject.hh.


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