Unicorn XML Toolkit
Version 1.00.00

Namespace Som
Class CObject

class CObject: public CInterface {
public:
    CObject();
    virtual ~CObject();
public:
    virtual void Get(
        const CString &strProperty,
        CValue &value) = 0;
    virtual void Put(
        const CString &strProperty,
        const CValue &value) = 0;
    virtual void Call(
        const CString &strMethod,
        int nArg,
        const CValue *pArg,
        CValue &result) = 0;
    };

The abstract interface to SOM objects.

This class provides few functions designed to access object properties and to call object methods.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CValue
Constructor/Destructor Summary
CObject ();
����������Constructs the object.
~CObject ();
����������Destroys the object.

Function Summary
void Get (const CString &strProperty, CValue &value);
����������Returns a value of the specified property of this object.
void Put (const CString &strProperty, const CValue &value);
����������Assigns the new value to the specified property of this object.
void Call (const CString &strMethod, int nArg, const CValue *pArg, CValue &result);
����������Calls the specified method of this object with the specified list of arguments.

Constructor/Destructor Detail

CObject

CObject();

Constructs the object.

~CObject

virtual ~CObject();

Destroys the object.

Function Detail

Get

virtual void Get(
    const CString &strProperty,
    CValue &value) = 0;

Returns a value of the specified property of this object.

An exception must be thrown if this object has no specified property.

Parameters:
strProperty - the property name
value - on return, the value of the specified property

Put

virtual void Put(
    const CString &strProperty,
    const CValue &value) = 0;

Assigns the new value to the specified property of this object.

If this object had no specified property before, the result of calling this function is platform-dependent.

Parameters:
strProperty - the property name
value - the new property value

Call

virtual void Call(
    const CString &strMethod,
    int nArg,
    const CValue *pArg,
    CValue &result) = 0;

Calls the specified method of this object with the specified list of arguments.

The actual values for method arguments are passed using parameters nArg and pArg . The nArg contains the number of arguments, while pArg points to the array of argument values. If the method does not require arguments, then nArg must be 0 , and pArg may be set to NULL .

On return, the result parameter is assigned the value returned by the method. If the method does not return any value, the result must be assigned type typeVoid .

An exception must be thrown if this object does not implement the specified method.

Parameters:
strMethod - the method name
nArg - the number of arguments
pArg - the array of argument values
result - on return, the value containing the result of the method call

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.