Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

vos/metaobjects/policy/hostedavatar.hh

Go to the documentation of this file.
00001 /* $Id: hostedavatar.hh,v 1.5 2003/07/24 05:18:18 tetron Exp $ */
00002 
00003 
00004 /** @file hostedAvatar.hh Defines MetaObject class for "policy:hostedAvatar" object type (revision 0). */
00005 
00006 /* This file was generated by otd2cpp.pl, a script for VOS by Reed Hedges
00007  * <reed@zerohour.net> and Peter Amstutz <tetron@interreality.org>
00008  *
00009  * Search for TODO for stuff that needs editing. You will want to especially fill
00010  * in constructors, destructors, message handlers, non-property subobjects...
00011  *
00012  * The authors of otd2cpp make no guarantee that this code will work, or even
00013  * that it even is safe to run.  Use it at your own risk.
00014  */
00015 
00016 #ifndef _POLICY_HOSTEDAVATAR_HH_
00017 #define _POLICY_HOSTEDAVATAR_HH_
00018 
00019 
00020 #include <vos/corelibs/vos/vos.hh>
00021 #include <vos/metaobjects/property/property.hh>
00022 
00023 #if defined(_WIN32) && defined(_MSC_VER)
00024 # ifdef POLICY_EXPORTS
00025 #  define POLICY_API __declspec(dllexport)
00026 # else
00027 #  define POLICY_API __declspec(dllimport)
00028 # endif
00029 #else
00030 # define POLICY_API
00031 #endif
00032 
00033 class POLICY_API HostedAvatarAccessControl
00034 {
00035 public:
00036     virtual ~HostedAvatarAccessControl() { };
00037     virtual bool checkRequestAvatarPermission(Vobject& requester, Vobject* suppliedavatar) = 0;
00038 };
00039 
00040 class POLICY_API NoHostedAvatarAccessControl : public HostedAvatarAccessControl
00041 {
00042 public:
00043     static NoHostedAvatarAccessControl static_;
00044     virtual ~NoHostedAvatarAccessControl() { };
00045     virtual bool checkRequestAvatarPermission(Vobject& requester, Vobject* suppliedavatar) { return true; }
00046 };
00047 
00048 /** MetaObject implementing HostedAvatar Object Type.
00049 
00050         Indended to be used by virtual worlds and other vobjects where there is a possibility for
00051 
00052 */
00053 
00054 class POLICY_API HostedAvatar : public virtual MetaObject {
00055 
00056 protected:
00057     PropertyAccessControl* accessControl;
00058 
00059 
00060 public:
00061 
00062     /** Constructor */
00063     HostedAvatar(MetaObject* superobject);
00064 
00065     /** Destructor */
00066     virtual ~HostedAvatar();
00067 
00068     /** Return type string ("policy:hostedAvatar") */
00069     virtual const string getType();
00070 
00071     /** Register Extenders */
00072     static void registerExtenders();
00073 
00074     /** Set default access control policy */
00075     virtual void setPropertyAccessControl(PropertyAccessControl* ac);
00076 
00077     /** Get default access control policy */
00078     virtual PropertyAccessControl* getPropertyAccessControl();
00079 
00080     /** @name Access Subobjects */
00081     //@{
00082 
00083     /** Get the value of policy:hosted-avatar-is-required property (Whether using a hosted avatar is required to use this world, or
00084             merely optional (datatype is text/x-yes-or-no) .). */
00085     virtual string getHostedAvatarIsRequired();
00086 
00087     /** Get the datatype of policy:hosted-avatar-is-required property. */
00088     virtual string getHostedAvatarIsRequiredDatatype();
00089 
00090     /** Set policy:hosted-avatar-is-required property.
00091         @param value The new value
00092         @param datatype The new datatype: if omitted, then the existing datatype will be preserved.
00093         @param ac Property access control policy. If omitted, then &NoAccessControl::static_ will be used.
00094     */
00095     virtual void setHostedAvatarIsRequired(const string& value, const string& datatype = "?", PropertyAccessControl* ac = NULL);
00096 
00097     /** Get the policy:hosted-avatar-is-required object. */
00098     virtual Vobject* getHostedAvatarIsRequiredObject();
00099 
00100     /** Set the policy:hosted-avatar-is-required object.
00101         @param newobj   The new subobject. */
00102     virtual void setHostedAvatarIsRequiredObject(Vobject* newobj);
00103 
00104     //@}
00105 
00106 
00107     /** @name Actuators. User-functions that correspond to
00108 message actions. */
00109     //@{
00110 
00111     /** Perform request-avatar. (Request an avatar to be created on the remote server, possiblyfollowing the template described by "myavatar".) */
00112     virtual Vobject& doRequestAvatar(Vobject* myavatar) = 0;
00113 
00114     //@}
00115 };
00116 
00117 /** Local version of HostedAvatar. */
00118 
00119 class POLICY_API LocalHostedAvatar : public virtual HostedAvatar {
00120 protected:
00121     HostedAvatarAccessControl* hostedavatarAC;
00122 public:
00123 
00124     /** Constructor */
00125     LocalHostedAvatar(MetaObject* superobject);
00126 
00127     /** Destructor */
00128     ~LocalHostedAvatar();
00129 
00130     /** Initialize required subproperties with given access control. */
00131     virtual void initialize(PropertyAccessControl* ac);
00132 
00133     /** Initialize required subproperties. If access control has been
00134         previously set with initialize(PropertyAccessControl*) or
00135         setPropertyAccessControl(), then that policy will be used. Otherwise,
00136         NoPropertyAccessControl will be used.
00137     */
00138     virtual void initialize();
00139 
00140     /** Static generator, for factory. */
00141     static MetaObject* new_LocalHostedAvatar(MetaObject* superobject, const string& type);
00142 
00143     /**  @name Actuators. These methods correspond to messages. */
00144     //@{
00145 
00146     /** Perform request-avatar. (Request an avatar to be created on the remote server, possiblyfollowing the template described by "myavatar".) */
00147     virtual Vobject& doRequestAvatar(Vobject* myavatar);
00148 
00149     //@}
00150 
00151     virtual void setHostedAvatarAccessControl(HostedAvatarAccessControl* haac) { hostedavatarAC = haac; }
00152     virtual HostedAvatarAccessControl* getHostedAvatarAccessControl() { return hostedavatarAC; }
00153 
00154 protected:
00155 
00156     /** @name Message Handlers */
00157     //@{
00158 
00159     /** Handle message request-avatar (Request an avatar to be created on the remote server, possiblyfollowing the template described by "myavatar".) */
00160     virtual void handleRequestAvatar(Message* m);
00161 
00162     //@}
00163 
00164 
00165 };
00166 
00167 /** Remote proxy for HostedAvatar */
00168 
00169 class POLICY_API RemoteHostedAvatar : public virtual HostedAvatar {
00170 
00171 public:
00172 
00173     /** Constructor */
00174     RemoteHostedAvatar(MetaObject* superobject);
00175 
00176     /** Destructor */
00177     virtual ~RemoteHostedAvatar();
00178 
00179     /** Static generator, for factory. */
00180     static MetaObject* new_RemoteHostedAvatar(MetaObject* superobject, const string& type);
00181 
00182     /** @name Actuators.
00183         These are user-functions corresponding to messages. The remote actuators marshal arguments and send a message to the Local object. */
00184     //@{
00185     /** Send a request-avatar messsage to the local object. */
00186     virtual Vobject& doRequestAvatar(Vobject* myavatar);
00187 
00188 
00189     //@}
00190 
00191 
00192 protected:
00193 
00194     /** @name Update Handlers. Handlers for remote update messages */
00195     //@{
00196 
00197     /** Handle a request-avatar-reply messsage from the local object. */
00198     virtual void handleRequestAvatarReply(Message* m);
00199 
00200     //@}
00201 
00202 };
00203 
00204 
00205 #endif // #ifndef _POLICY_HOSTEDAVATAR_HH_
00206 

Generated on Tue Aug 12 03:55:45 2003 for Interreality Project - VOS by doxygen 1.3.2