
/*
 * This file was generated by the SOM Compiler.
 * FileName: cntxt.xh.
 * Generated using:
 *     SOM Precompiler somipc: 2.29.1.19
 *     SOM Emitter emitxh.dll: 2.108
 */

/*
 *    COMPONENT_NAME: somd
 * 
 *    ORIGINS: 27
 * 
 * 
 *     25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996
 *    All Rights Reserved
 *    Licensed Materials - Property of IBM
 *    US Government Users Restricted Rights - Use, duplication or
 *    disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 * 
 *   IDL specification for the CORBA Context Object.
 *   A Context object contains a list of properties, each consisting of a name
 *   and a string value associated with that name.  Context properties represent
 *   information about the client, environment, or circumstances of a request
 *   that are inconvenient to pass as parameters.
 */


#ifndef SOM_Context_xh
#define SOM_Context_xh


#define Context_MajorVersion 2
#define Context_MinorVersion 2
class Context;

/* Parents */
#ifndef SOM_SOMObject_xh
#ifdef SOMLOCALINCLUDES
#include "somobj.xh"
#else
#include <somobj.xh>
#endif
#endif

/* Useful C++ SOM defs */
#include <somcls.xh>
#include <somcm.xh>

#ifndef Context_API
#define Context_API
/*
 * -- The Class API
 */
#ifndef SOM_IMPORTEXPORT_somd_cntxt
#ifdef SOM_DLL_somd
	/* export semantics */
	#if defined(SOM_DEFFILE_somd)\
	||(defined(SOM_DEFFILE_BY_DEFAULT)&&!defined(SOM_NODEFFILE_somd))\
	|| !defined(SOM_Module_cntxt_Source)
	#define SOM_IMPORTEXPORT_somd_cntxt
	#else
	#define SOM_IMPORTEXPORT_somd_cntxt SOMDLLEXPORT
	#endif
#else
	#define SOM_IMPORTEXPORT_somd_cntxt SOMDLLIMPORT
#endif
#endif

/*
 * Start of bindings for IDL types
 */

class SOMClass;
class SOMObject;
class Container;
class NVList;

/*
 * End of bindings for IDL types.
 */

/*
 * Passthru lines: File: "C.xh", "after"
 */

/*
 * Context flags
 */
#define CTX_DELETE_DESCENDENTS      0x00000200
#define CTX_RESTRICT_SCOPE          0x00000400


/*
 * A function to create the Context class object...
 */
SOMEXTERN SOM_IMPORTEXPORT_somd_cntxt SOMClass * SOMLINK ContextNewClass(
		integer4 majorVersion,
		integer4 minorVersion);


/*
 * The API 2 ClassData Structures...
 */
SOMEXTERN struct ContextClassDataStructure {
	SOMClass *classObject;
	somMToken set_one_value;
	somMToken set_values;
	somMToken get_values;
	somMToken delete_values;
	somMToken create_child;
	somMToken destroy;
	somMToken _get_context_name;
	somMToken _set_context_name;
	somMToken _get_context_parent;
	somMToken _set_context_parent;
	somMToken _get_properties;
	somMToken _set_properties;
} SOMDLINK SOM_IMPORTEXPORT_somd_cntxt ContextClassData;
SOMEXTERN struct ContextCClassDataStructure {
	som3ClassDetailsPtr    parentMtab;
	somDToken              instanceDataToken;
} SOMDLINK SOM_IMPORTEXPORT_somd_cntxt ContextCClassData;


/*
 * Class Object and Method Token Macros
 */
#define _SOMCLASS_Context (ContextClassData.classObject)
#ifndef SOMGD_Context
    #if (defined(_Context) || defined(__Context))
        #undef _Context
        #undef __Context
        #define SOMGD_Context 1
    #else
        #define _Context _SOMCLASS_Context
    #endif /* _Context */
#endif /* SOMGD_Context */
#define Context_classObj _SOMCLASS_Context
#define _SOMMTOKEN_Context(method) ((somMToken)ContextClassData.method)

/*
 * -- Typedefs for Context Method Procedures
 */
SOMEXTERN {
typedef ORBStatus   SOMLINK somTP_Context_set_one_value(Context *somSelf, Environment *ev, 
		Identifier prop_name, 
		string value);
typedef somTP_Context_set_one_value *somTD_Context_set_one_value;
typedef ORBStatus   SOMLINK somTP_Context_set_values(Context *somSelf, Environment *ev, 
		NVList* values);
typedef somTP_Context_set_values *somTD_Context_set_values;
typedef ORBStatus   SOMLINK somTP_Context_get_values(Context *somSelf, Environment *ev, 
		Identifier start_scope, 
		Flags op_flags, 
		Identifier prop_name, 
		NVList** values);
typedef somTP_Context_get_values *somTD_Context_get_values;
typedef ORBStatus   SOMLINK somTP_Context_delete_values(Context *somSelf, Environment *ev, 
		Identifier prop_name);
typedef somTP_Context_delete_values *somTD_Context_delete_values;
typedef ORBStatus   SOMLINK somTP_Context_create_child(Context *somSelf, Environment *ev, 
		Identifier ctx_name, 
		Context** child_ctx);
typedef somTP_Context_create_child *somTD_Context_create_child;
typedef ORBStatus   SOMLINK somTP_Context_destroy(Context *somSelf, Environment *ev, 
		Flags flags);
typedef somTP_Context_destroy *somTD_Context_destroy;

/*
 * -- Typedefs for Reintroduced Wrapper Methods
 */
typedef void   SOMLINK somTP_Context_somDefaultInit(Context *somSelf, 
		som3InitCtrl* ctrl);
typedef somTP_Context_somDefaultInit *somTD_Context_somDefaultInit;
typedef void   SOMLINK somTP_Context_somDestruct(Context *somSelf, 
		octet doFree, 
		som3DestructCtrl* ctrl);
typedef somTP_Context_somDestruct *somTD_Context_somDestruct;
typedef void   SOMLINK somTP_Context_somDefaultCopyInit(Context *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_Context_somDefaultCopyInit *somTD_Context_somDefaultCopyInit;
typedef Context*   SOMLINK somTP_Context_somDefaultAssign(Context *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_Context_somDefaultAssign *somTD_Context_somDefaultAssign;
typedef void   SOMLINK somTP_Context_somDefaultConstCopyInit(Context *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_Context_somDefaultConstCopyInit *somTD_Context_somDefaultConstCopyInit;
typedef void   SOMLINK somTP_Context_somDefaultVCopyInit(Context *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_Context_somDefaultVCopyInit *somTD_Context_somDefaultVCopyInit;
typedef void   SOMLINK somTP_Context_somDefaultConstVCopyInit(Context *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_Context_somDefaultConstVCopyInit *somTD_Context_somDefaultConstVCopyInit;
typedef Context*   SOMLINK somTP_Context_somDefaultConstAssign(Context *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_Context_somDefaultConstAssign *somTD_Context_somDefaultConstAssign;
typedef Context*   SOMLINK somTP_Context_somDefaultVAssign(Context *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_Context_somDefaultVAssign *somTD_Context_somDefaultVAssign;
typedef Context*   SOMLINK somTP_Context_somDefaultConstVAssign(Context *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_Context_somDefaultConstVAssign *somTD_Context_somDefaultConstVAssign;
typedef void   SOMLINK somTP_Context_somInit(Context *somSelf);
typedef somTP_Context_somInit *somTD_Context_somInit;
typedef void   SOMLINK somTP_Context_somUninit(Context *somSelf);
typedef somTP_Context_somUninit *somTD_Context_somUninit;
typedef void   SOMLINK somTP_Context_somFree(Context *somSelf);
typedef somTP_Context_somFree *somTD_Context_somFree;
typedef SOMClass*   SOMLINK somTP_Context_somGetClass(Context *somSelf);
typedef somTP_Context_somGetClass *somTD_Context_somGetClass;
typedef string   SOMLINK somTP_Context_somGetClassName(Context *somSelf);
typedef somTP_Context_somGetClassName *somTD_Context_somGetClassName;
typedef long   SOMLINK somTP_Context_somGetSize(Context *somSelf);
typedef somTP_Context_somGetSize *somTD_Context_somGetSize;
typedef boolean   SOMLINK somTP_Context_somIsA(Context *somSelf, 
		SOMClass* aClassObj);
typedef somTP_Context_somIsA *somTD_Context_somIsA;
typedef boolean   SOMLINK somTP_Context_somIsInstanceOf(Context *somSelf, 
		SOMClass* aClassObj);
typedef somTP_Context_somIsInstanceOf *somTD_Context_somIsInstanceOf;
typedef boolean   SOMLINK somTP_Context_somRespondsTo(Context *somSelf, 
		somId mId);
typedef somTP_Context_somRespondsTo *somTD_Context_somRespondsTo;
typedef boolean   SOMLINK somTP_Context_somDispatch(Context *somSelf, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_Context_somDispatch *somTD_Context_somDispatch;
typedef boolean   SOMLINK somTP_Context_somClassDispatch(Context *somSelf, 
		SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_Context_somClassDispatch *somTD_Context_somClassDispatch;
typedef boolean   SOMLINK somTP_Context_somCastObj(Context *somSelf, 
		SOMClass* castedCls);
typedef somTP_Context_somCastObj *somTD_Context_somCastObj;
typedef boolean   SOMLINK somTP_Context_somResetObj(Context *somSelf);
typedef somTP_Context_somResetObj *somTD_Context_somResetObj;
typedef Context*   SOMLINK somTP_Context_somPrintSelf(Context *somSelf);
typedef somTP_Context_somPrintSelf *somTD_Context_somPrintSelf;
typedef void   SOMLINK somTP_Context_somDumpSelf(Context *somSelf, 
		long level);
typedef somTP_Context_somDumpSelf *somTD_Context_somDumpSelf;
typedef void   SOMLINK somTP_Context_somDumpSelfInt(Context *somSelf, 
		long level);
typedef somTP_Context_somDumpSelfInt *somTD_Context_somDumpSelfInt;
}

#endif /* Context_API */


/*
 * -- The C++ Wrapper Class for Context
 */
class Context : public SOMObject
{
public:

// Context::new creates the class object if necessary, and then uses
// somNewNoInit to allocate memory and create the object.
// Initialization is in ctors.
void *operator new(size_t)
{
   if (!_Context) ContextNewClass(Context_MajorVersion,Context_MinorVersion);
   return (void*)
   (((somTD_SOMClass_somNewNoInit)(SOMClassClassData.somNewNoInit))
         ((SOMClass *)((void*)_Context)));
}

// Context::delete uses somFree.
void operator delete(void * obj)
{
   if (obj && *(void**)obj)
      ((SOMObject*)obj)->somFree();
}

Context& operator=(Context& fromObj)
{
   this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
   return *this;
}

Context()
{
   if (*(void**)this != (ContextCClassData.parentMtab)->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultInit(0);
}

Context(Context* fromObj)
{
   if (*(void**)this != (ContextCClassData.parentMtab)->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
}


/* method: set_one_value */
ORBStatus   set_one_value(Environment *ev, 
		Identifier prop_name, 
		string value)
{
/*
 *   This method sets or adds a single context object property. If prop_name
 *   does not exist in the property list, it is added. If prop_name
 *   does exist, its value is changed.
 *   A nonzero return result indicates failure.
 * 
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_Context),
	 ((somTD_Context_set_one_value)(ContextClassData.set_one_value))(((Context *)((void *)this)), ev,prop_name,value)
	);
}


/* method: set_values */
ORBStatus   set_values(Environment *ev, 
		NVList* values)
{
/*
 *   This method sets or changes one or more property values in the context
 *   object. If a prop_name specified in the NVList does not exist in the
 *   Context object property list, it is added. If a prop_name specified in
 *   the NVList does exist in the Context object property list, its value
 *   is changed.
 *   A nonzero return result indicates failure.
 * 
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_Context),
	 ((somTD_Context_set_values)(ContextClassData.set_values))(((Context *)((void *)this)), ev,values)
	);
}


/* method: get_values */
ORBStatus   get_values(Environment *ev, 
		Identifier start_scope, 
		Flags op_flags, 
		Identifier prop_name, 
		NVList** values)
{
/*
 *   This method retrieves the specified context property value(s). If
 *   prop_name has a trailing wildcard ("*"), then all matching properties
 *   and their values are returned. The returned NVList (values) is the
 *   responsibility of the caller.
 * 
 *   If no matching properties are found, and error is returned the property
 *   list (values) contains no property values.
 *   A nonzero return result indicates failure.
 * 
 *   start_scope indicates the context object level at which to initiate the search
 *   for the specified properties (e.g. "_USER", "_SYSTEM"). If the property
 *   is not found at the indicated level, the search continues up the context
 *   object tree until a match is found or all context objects in the chain
 *   have been searched.
 * 
 *   If start_scope name is NULL, the search begins with the target Context
 *   object. If the specified start_scope name is not found, an exception is
 *   returned.
 * 
 *   The op_flags may specify CTX_RESTRICT_SCOPE, indicating that searching
 *   is to be limited to the specified search scope or Context object.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_Context),
	 ((somTD_Context_get_values)(ContextClassData.get_values))(((Context *)((void *)this)), ev,start_scope,op_flags,prop_name,values)
	);
}


/* method: delete_values */
ORBStatus   delete_values(Environment *ev, 
		Identifier prop_name)
{
/*
 *   This method deletes the specified property value(s) from the context
 *   object.  If prop_name has a trailing wildcard character ("*"), then
 *   all property names which match will be deleted.
 * 
 *   Search scope is always limited to the target context object.
 * 
 *   If no matching property is found, an exception is returned.
 *   A nonzero return result indicates failure.
 * 
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_Context),
	 ((somTD_Context_delete_values)(ContextClassData.delete_values))(((Context *)((void *)this)), ev,prop_name)
	);
}


/* method: create_child */
ORBStatus   create_child(Environment *ev, 
		Identifier ctx_name, 
		Context** child_ctx)
{
/*
 *   This method creates a child context object.
 * 
 *   The returned context object is chained to its parent context. That is,
 *   searches on the child context object will look in the parent context
 *   (and so on, up the context tree), if necessary, for matching property
 *   names.
 *   A nonzero return result indicates failure.
 * 
 *   The ctx_name parameter indicates the name of the child Context object.
 *   The child_ctx parameter is used to return the new child Context object.
 * 
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_Context),
	 ((somTD_Context_create_child)(ContextClassData.create_child))(((Context *)((void *)this)), ev,ctx_name,child_ctx)
	);
}


/* method: destroy */
ORBStatus   destroy(Environment *ev, 
		Flags flags)
{
/*
 *   This operation deletes the indicated context object.
 *   The following "flags" may be specified:
 * 
 *   CTX_DELETE_DESCENDENTS    Deletes the indicated context object and all
 *                             of its descendent context objects as well.
 * 
 *   An exception is returned if there are one or more child context objects
 *   and the CTX_DELETE_DESCENDENTS flag was not set.
 *   A nonzero return result indicates failure.
 * 
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_Context),
	 ((somTD_Context_destroy)(ContextClassData.destroy))(((Context *)((void *)this)), ev,flags)
	);
}


/*
 * Reintroduce inherited methods
 */

/* initializer method: somDefaultInit */
void   somDefaultInit(som3InitCtrl* ctrl)
{
/*
 *  A default initializer for a SOM object. Passing a null ctrl
 *  indicates to the receiver that its class is the class of the
 *  object being initialized, whereby the initializer will determine
 *  an appropriate control structure.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDefaultInit)(SOMObjectClassData.somDefaultInit))(((Context *)((void *)this)),ctrl)
	);
}


/* method: somDestruct */
void   somDestruct(octet doFree, 
		som3DestructCtrl* ctrl)
{
/*
 *  The default destructor for a SOM object. A nonzero <doFree>
 *  indicates that the object storage should be freed by the
 *  object's class (via somDeallocate) after uninitialization.
 *  As with somDefaultInit, a null ctrl can be passed.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDestruct)(SOMObjectClassData.somDestruct))(((Context *)((void *)this)),doFree,ctrl)
	);
}


/* initializer method: somDefaultCopyInit */
void   somDefaultCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor. Use this to make copies of objects for
 *  calling methods with "by-value" argument semantics.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDefaultCopyInit)(SOMObjectClassData.somDefaultCopyInit))(((Context *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultAssign */
Context*  somDefaultAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator. Use this to "assign" the state of one
 *  object to another.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDefaultAssign)(SOMObjectClassData.somDefaultAssign))(((Context *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultConstCopyInit */
void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDefaultConstCopyInit)(SOMObjectClassData.somDefaultConstCopyInit))(((Context *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultVCopyInit */
void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a volatile fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDefaultVCopyInit)(SOMObjectClassData.somDefaultVCopyInit))(((Context *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultConstVCopyInit */
void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const volatile fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDefaultConstVCopyInit)(SOMObjectClassData.somDefaultConstVCopyInit))(((Context *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultConstAssign */
Context*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDefaultConstAssign)(SOMObjectClassData.somDefaultConstAssign))(((Context *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultVAssign */
Context*  somDefaultVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a volatile fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDefaultVAssign)(SOMObjectClassData.somDefaultVAssign))(((Context *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultConstVAssign */
Context*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const volatile fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDefaultConstVAssign)(SOMObjectClassData.somDefaultConstVAssign))(((Context *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somInit */
void   somInit()
{
/*
 *  Obsolete but still supported. Override somDefaultInit instead of somInit.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somInit)(SOMObjectClassData.somInit))(((Context *)((void *)this)))
	);
}


/* method: somUninit */
void   somUninit()
{
/*
 *  Obsolete but still supported. Override somDestruct instead of somUninit.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somUninit)(SOMObjectClassData.somUninit))(((Context *)((void *)this)))
	);
}


/* method: somFree */
void   somFree()
{
/*
 *  The default implementation just calls somDestruct.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somFree)(SOMObjectClassData.somFree))(((Context *)((void *)this)))
	);
}


/* method: somGetClass */
SOMClass*   somGetClass()
{
/*
 *  Return the receiver's class.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somGetClass)(SOMObjectClassData.somGetClass))(((Context *)((void *)this)))
	);
}


/* method: somGetClassName */
string   somGetClassName()
{
/*
 *  Return the name of the receiver's class.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somGetClassName)(SOMObjectClassData.somGetClassName))(((Context *)((void *)this)))
	);
}


/* method: somGetSize */
long   somGetSize()
{
/*
 *  Return the size of the receiver.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somGetSize)(SOMObjectClassData.somGetSize))(((Context *)((void *)this)))
	);
}


/* method: somIsA */
boolean   somIsA(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver responds to methods
 *  introduced by <aClassObj>, and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somIsA)(SOMObjectClassData.somIsA))(((Context *)((void *)this)),aClassObj)
	);
}


/* method: somIsInstanceOf */
boolean   somIsInstanceOf(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver is an instance of
 *  <aClassObj> and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somIsInstanceOf)(SOMObjectClassData.somIsInstanceOf))(((Context *)((void *)this)),aClassObj)
	);
}


/* method: somRespondsTo */
boolean   somRespondsTo(somId mId)
{
/*
 *  Returns 1 (true) if the indicated method can be invoked
 *  on the receiver and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somRespondsTo)(SOMObjectClassData.somRespondsTo))(((Context *)((void *)this)),mId)
	);
}


/* va_list method: somDispatch */

/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 * 
 *  Default redispatch stubs invoke this method.
 */
/* the va_list invocation form */
boolean   SOMObject_somDispatch(somToken* retValue, 
		somId methodId, 
		va_list ap)
{   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDispatch)(SOMObjectClassData.somDispatch))(((Context *)((void *)this)),retValue,methodId,ap)
	);
}

/* the varargs invocation form */
boolean   somDispatch(somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 * 
 *  Default redispatch stubs invoke this method.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDispatch)(SOMObjectClassData.somDispatch))(((Context *)((void *)this)),retValue,methodId,ap)
	);
   va_end(ap);
   return __somResult;
}


/* va_list method: somClassDispatch */

/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
/* the va_list invocation form */
boolean   SOMObject_somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap)
{   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somClassDispatch)(SOMObjectClassData.somClassDispatch))(((Context *)((void *)this)),clsObj,retValue,methodId,ap)
	);
}

/* the varargs invocation form */
boolean   somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somClassDispatch)(SOMObjectClassData.somClassDispatch))(((Context *)((void *)this)),clsObj,retValue,methodId,ap)
	);
   va_end(ap);
   return __somResult;
}


/* method: somCastObj */
boolean   somCastObj(SOMClass* castedCls)
{
/*
 *  Changes the behavior of the target object to that implemented
 *  by castedCls. This is possible when all concrete data in castedCls
 *  is also concrete in the true class of the target object.
 *  Returns true (1) on success, and false (0) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somCastObj)(SOMObjectClassData.somCastObj))(((Context *)((void *)this)),castedCls)
	);
}


/* method: somResetObj */
boolean   somResetObj()
{
/*
 *  reset an object to its true class. Returns true always.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somResetObj)(SOMObjectClassData.somResetObj))(((Context *)((void *)this)))
	);
}


/* method: somPrintSelf */
Context*  somPrintSelf()
{
/*
 *  Uses <SOMOutCharRoutine> to write a brief string with identifying
 *  information about this object.  The default implementation just gives
 *  the object's class name and its address in memory.
 *  <self> is returned.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somPrintSelf)(SOMObjectClassData.somPrintSelf))(((Context *)((void *)this)))
	);
}


/* method: somDumpSelf */
void   somDumpSelf(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write a detailed description of this object
 *  and its current state.
 * 
 *  <level> indicates the nesting level for describing compound objects
 *  it must be greater than or equal to zero.  All lines in the
 *  description will be preceeded by <2*level> spaces.
 * 
 *  This routine only actually writes the data that concerns the object
 *  as a whole, such as class, and uses <somDumpSelfInt> to describe
 *  the object's current state.  This approach allows readable
 *  descriptions of compound objects to be constructed.
 * 
 *  Generally it is not necessary to override this method, if it is
 *  overriden it generally must be completely replaced.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDumpSelf)(SOMObjectClassData.somDumpSelf))(((Context *)((void *)this)),level)
	);
}


/* method: somDumpSelfInt */
void   somDumpSelfInt(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write in the current state of this object.
 *  Generally this method will need to be overridden.  When overriding
 *  it, begin by calling the parent class form of this method and then
 *  write in a description of your class's instance data. This will
 *  result in a description of all the object's instance data going
 *  from its root ancestor class to its specific class.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_Context_somDumpSelfInt)(SOMObjectClassData.somDumpSelfInt))(((Context *)((void *)this)),level)
	);
}



};   /* Context */



#endif       /* SOM_Context_xh */
