Objects, interfaces, and methods

Objects, interfaces, and methods are fundamental notions in PODS. In PODS, an object is an implementation of an interface. Each interface defines a set of methods that can be invoked on the objects that implement the interface.

PODS defines a number of built-in interfaces, each in its own header file or in a header file that defines several closely related interfaces. M-Business Client provides browser objects that implement these interfaces. For example, podsprefs.h defines the interface PODSPrefs, which includes the following methods:

PODSString (*m_getStringValueForKey)
(PODSPrefs*, PODSString);
void (*m_setStringValueForKey)
(PODSPrefs*, PODSString, PODSString);
PODSBoolean (*m_getBoolValueForKey)
(PODSPrefs*, PODSString);
void (*m_setBoolValueForKey)
(PODSPrefs*, PODSString, PODSBoolean);
PODSUInt32 (*m_getUInt32ValueForKey)
(PODSPrefs*, PODSString);
void (*m_setUInt32ValueForKey)
(PODSPrefs*,PODSString,    PODSUInt32);
PODSInt32 (*m_getInt32ValueForKey)
(PODSPrefs*, PODSString);
void (*m_setInt32ValueForKey)
(PODSPrefs*, PODSString,   PODSInt32);
PODSUInt8* (*m_getBytesForKey)
(PODSPrefs*, PODSString,   PODSInt32*);
void (*m_setBytesForKey)
(PODSPrefs*, PODSString,   PODSUInt8*,    PODSUInt32);

Each of the above method definitions show the method's arguments and return type. Note that these are not C function prototypes; they are actually defined in podsprefs.h using a more complicated syntax (described below). You invoke these methods through macros.

Each PODS interface has a corresponding C structure to define the objects that implement the interface. For example, structures in podsprefs.h define the PODSPrefs interface. The podsprefs.h header defines a macro for each method in each interface that the podsprefs.h header defines. You call the methods through the macros. The first argument to the macro must be a pointer to the object on which you want to invoke the method:

PODSPrefs* p; 
PODSBoolean b = PODSgetBoolValueForKey(p, PREFS_SHOWIMAGES);
Note

M-Business Client does not call the PODSPod object's destroy( ) method on loaded PODs until most other objects in the system are destroyed. This means that some PODs may not be able to do required cleanup before they are unloaded.