These functions are used to determine memory requirements for and initialize the IRES protocol's environment that will be allocated by the resource manager. More...
#include <iresman_protocol.h>
Data Fields | |
String(* | getName )() |
IRES_ProtocolRevision *(* | getRevision )() |
IRES_Status(* | getMemRecs )(IRES_Handle handle, IRES_ProtocolArgs *protocolArgs, IALG_MemRec *memRecs) |
Int(* | getNumMemRecs )(IRES_ProtocolArgs *protocolArgs) |
IRES_Handle(* | constructHandle )(IRES_ProtocolArgs *protocolArgs, IALG_MemRec *memRecs, IRESMAN_ConstructArgs *constructHandleArgs, IRES_Status *status) |
IRES_Status(* | destructHandle )(IRES_Handle handle) |
These functions are used to determine memory requirements for and initialize the IRES protocol's environment that will be allocated by the resource manager.
String(* IRESMAN_ConstructFxns::getName)() |
Query for identification for protocol
Query for revision of the protocol
IRES_Status(* IRESMAN_ConstructFxns::getMemRecs)(IRES_Handle handle, IRES_ProtocolArgs *protocolArgs, IALG_MemRec *memRecs) |
Obtain the memory requirements that must be allocated by the framework to construct a resource handle.
The 'protocol' determines the size and attributes of the memory that represents the logical resource. The size must be at least the size of IRES_Obj. The first sizeof(IRES_Obj) bytes are assigned by the Resource Manager, the protocol may request additional 'environment' memory to follow the IRES_Obj.
The "IRES_Handle handle" argument may be NULL, in which case the resource protocol fills in the memRecs with the attributes of the memory that is needed to create a handle.
Resource Manager may call this function anytime after the 'constructHandle()' call with a valid IRES_Handle to find out the memory assigned to the resource handle. Prior to the 'constructHandle()' call, or when a NULL IRES_Handle argument is supplied, the value(s) returned in the memRecs' IALG_MemRec::base fields are undefined.
Int(* IRESMAN_ConstructFxns::getNumMemRecs)(IRES_ProtocolArgs *protocolArgs) |
Obtain the number of IALG memory request descriptors the protocol uses to request memory for the resource handle.
IRES_Handle(* IRESMAN_ConstructFxns::constructHandle)(IRES_ProtocolArgs *protocolArgs, IALG_MemRec *memRecs, IRESMAN_ConstructArgs *constructHandleArgs, IRES_Status *status) |
Protocol specific initialization function to finalize the creation a resource object (handle). The protocol::constructHandle function can extend the IRES_Obj structure and must store any additional allocated 'environment' memory within the resource handle and return the IALG_MemRec descriptors in protocol::getResourceMemRecs() function.
Two types of arguments are passed to this function, protocolArgs that are forwarded from the IRES_Protocol and the constructHandleArgs that consists of information from the Resource Manager required to construct a Resource handle. Return valid resource handle on success, and set status to IRES_OK. Return NULL and indicate an IRES Error status otherwise.
Perform any resource specific operations that may be required before the resource is reclaimed by the resource manager.