40 #ifndef _scriptargument_h
41 #define _scriptargument_h
82 virtual String GetString()
const = 0;
86 virtual Whole GetWhole()
const = 0;
90 virtual Integer GetInteger()
const = 0;
94 virtual Real GetReal()
const = 0;
98 virtual Boole GetBoole()
const = 0;
102 virtual Boole IsNull()
const = 0;
106 virtual Integer GetTypeData()
const = 0;
185 {
return GetString()==
"" && GetInteger()==0; }
241 {
return Whole(Datum); }
251 {
return Real(Datum); }
256 {
return Boole(Datum); }
327 {
return Real(Datum); }
332 {
return Boole(Datum); }
393 {
return ConvertTo<Whole>(Datum); }
398 {
return ConvertTo<Integer>(Datum); }
403 {
return ConvertTo<Real>(Datum); }
469 {
return Whole(Datum); }
484 {
return Boole(Datum); }
545 {
return Whole(Datum); }
555 {
return Real(Datum); }
799 #endif // \_scriptargument_h
A Real number implementation of a ScriptArgument that is suitable for primitive types in most situati...
virtual Integer GetTypeData() const
Get data about this being a Bool.
virtual ScriptArgumentGeneric< Boole > * GetMostDerived()
Get a pointer to the most Derived type of this class.
virtual ScriptArgumentGeneric< Real > * GetMostDerived()
Get a pointer to the most Derived type of this class.
Scripting::ScriptArgumentGeneric< Whole > RefCountType
The type that maintains the Reference count for ScriptArgumentGeneric with be ScriptArgumentGe...
Returned from GetTypeData() const when a ScriptArgumentGeneric is specialized as an Integer...
virtual Boole GetBoole() const
Get the Integer as a Boole.
String Type
To make working with this easier.
Scripting::ScriptArgumentGeneric< Scripting::NullArgument > RefCountType
The type that maintains the Reference count for ScriptArgumentGeneric with b...
ScriptArgument
A listing of the Base types an iScriptArgument could represent.
virtual String GetString() const
Get the Integer as a String.
virtual String GetValue() const
Get the raw primitive to value.
virtual Boole GetBoole() const
Get the String as a Boole.
bool Boole
Generally acts a single bit, true or false.
A Integer implementation of a ScriptArgument that is suitable for primitive types in most situations...
virtual Whole GetValue() const
Get the raw primitive to value.
NullArgument Datum
The Bool actual data.
virtual String GetString() const
Get the Real as a String.
virtual ~ScriptArgumentGeneric()
Overloadable Deconstructor.
A sample class that implements a minimal intrusive reference counting scheme.
Boole ToBool(const T &Datum)
Converts whatever to a Boole as long as the proper streaming operators are available for it...
Integer Datum
The Integer actual data.
virtual Whole GetWhole() const
Get the Argument as a Whole, slow default implementation.
This is not readily available when instantiating ScriptArgumentGeneric where T is unknown...
String ToString(const T &Datum)
Converts whatever to a String as long as a streaming operator is available for it.
virtual Real GetReal() const
Get Null as a Real.
virtual Real GetReal() const
Get the Whole as a Real.
Returned from GetTypeData() const when a ScriptArgumentGeneric is specialized as an Bool...
static RefCountType * ConstructionPointer(RefCountType *Target)
Given a pointer to the raw object this will return a pointer to an initialized reference count...
static RefCountType * ConstructionPointer(RefCountType *Target)
Given a pointer to the raw object this will return a pointer to an initialized reference count...
virtual ScriptArgumentGeneric< Integer > * GetMostDerived()
Get a pointer to the most Derived type of this class.
virtual Whole GetWhole() const
Get the Bool as a Whole.
virtual Boole IsNull() const
Is this value representing a Null/Nil value.
All the definitions for datatypes as well as some basic conversion functions are defined here...
virtual ScriptArgumentGeneric< Whole > * GetMostDerived()
Get a pointer to the most Derived type of this class.
virtual Boole GetBoole() const
Get the Real as a Boole.
int Integer
A datatype used to represent any integer close to.
Boole Datum
The Bool actual data.
virtual String GetString() const
Get the String.
virtual iScriptArgument * GetMostDerived()
Get a pointer to the most Derived type of this class.
Returned from GetTypeData() const when a ScriptArgumentGeneric is specialized as an Real...
virtual Real GetReal() const
Get the Real.
Returned from GetTypeData() const when a ScriptArgumentGeneric is intended as NullPtr, SQL Null, Lua Nil, Ruby nil, etc...
ScriptArgumentGeneric(T InitialValue)
Create an initialized Argument.
ScriptArgumentGeneric(NullArgument InitialValue=NullArgument())
Create an initialized Argument.
ScriptArgumentGeneric(Boole InitialValue)
Create an initialized Argument.
virtual ScriptArgumentGeneric< String > * GetMostDerived()
Get a pointer to the most Derived type of this class.
virtual Integer GetValue() const
Get the raw primitive to value.
static RefCountType * ConstructionPointer(RefCountType *Target)
Given a pointer to the raw object this will return a pointer to an initialized reference count...
ScriptArgumentGeneric(Real InitialValue)
Create an initialized Argument.
virtual ~ScriptArgumentGeneric()
Overloadable Deconstructor.
Boole Type
To make working with this easier.
virtual Real GetReal() const
Get the Bool as a Integer.
virtual Boole IsNull() const
Is this value representing a Null/Nil value.
A dynamic cast from the pointer as provided with no attempt to calls functions on the pointer target...
float Real
A Datatype used to represent a real floating point number.
A Whole number implementation of a ScriptArgument that is suitable for primitive types in most situat...
virtual T GetValue() const
Get the raw primitive to value.
virtual void SetValue(T NewValue)
Provide an overload point to change assignment that operators will use.
virtual Integer GetInteger() const
Get Null as a Integer.
virtual ~ScriptArgumentGeneric()
Overloadable Deconstructor.
Integer Type
To make working with this easier.
virtual void SetValue(String NewValue)
Provide an overload point to change assignment that operators will use.
This is used to deduce at compile if a specific class has built-in reference counting or needs an ext...
virtual Integer GetInteger() const
Get the Real as a Integer.
virtual Real GetReal() const
Get the Argument as a Real, slow default implementation.
virtual Boole IsNull() const
Is this value representing a Null/Nil value.
virtual Integer GetTypeData() const
Get data about this having an unknown type.
Returned from GetTypeData() const when a ScriptArgumentGeneric is specialized as an String...
virtual Integer GetInteger() const
Get the Bool as a Integer.
This is always equal to the maximum value in this enumeration so that other constant values can be ba...
Scripting::ScriptArgumentGeneric< Real > RefCountType
The type that maintains the Reference count for ScriptArgumentGeneric with be ScriptArgumentGen...
virtual Integer GetTypeData() const
Get data about this being a Whol.
Real Datum
The Real actual data.
virtual Boole GetValue() const
Get the raw primitive to value.
virtual ~ScriptArgumentGeneric()
Overloadable Deconstructor.
virtual ~ScriptArgumentGeneric()
Overloadable Deconstructor.
Returned from GetTypeData() const when a ScriptArgumentGeneric is specialized as an Whole...
A String implementation of a ScriptArgument that is suitable for primitive types in most situations...
This file describes and implements a reference counted pointer that is NOT threadsafe.
virtual Real GetReal() const
Get the String as a Real.
Whole Datum
The Whole actual data.
virtual String GetString() const
Get the Bool as a String.
ScriptArgumentGeneric(Integer InitialValue)
Create an initialized Argument.
virtual Boole GetBoole() const
Get the Whole Number as a Boole.
virtual NullArgument GetValue() const
Get the raw primitive to value.
virtual ScriptArgumentGeneric< T > * GetMostDerived()
Get a pointer to the most Derived type of this class.
virtual ~ScriptArgumentGeneric()
Overloadable Deconstructor.
virtual ~ScriptArgumentGeneric()
Overloadable Deconstructor.
virtual Boole GetBoole() const
Get the Argument as a Boole.
virtual String GetString() const
Get the Whole as a String.
static RefCountType * ConstructionPointer(RefCountType *Target)
Given a pointer to the raw object this will return a pointer to an initialized reference count...
virtual Real GetReal() const
Get the Integer as a Real.
virtual Boole IsNull() const
Is this value representing a Null/Nil value.
String Datum
The String data.
Real ToReal(const T &Datum)
Converts whatever to a Real as long as the proper streaming operators are available for it...
virtual Whole GetWhole() const
Get Null as a Whole.
A Bool implementation of a ScriptArgument that is suitable for primitive types in most situations...
virtual void SetValue(NullArgument NewValue)
Provide an overload point to change assignment that operators will use.
virtual Whole GetWhole() const
Get the String as a Whole.
A very simple type used to indicate to script argument templates that the argument represents...
Real Type
To make working with this easier.
virtual Integer GetTypeData() const
Get data about this being a Bool.
virtual ~iScriptArgument()
Overidable Deconstructor.
The bulk of the engine components go in this namspace.
virtual Boole IsNull() const
Is this value representing a Null/Nil value.
virtual Boole IsNull() const
Is this value representing a Null/Nil value.
Whole Type
To make working with this easier.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
Scripting::ScriptArgumentGeneric< Integer > RefCountType
The type that maintains the Reference count for ScriptArgumentGeneric with be ScriptArgument...
virtual Integer GetInteger() const
Get the String as a Integer.
ScriptArgumentGeneric(Whole InitialValue)
Create an initialized Argument.
T Type
To make working with this easier.
virtual Integer GetTypeData() const
Get data about this being and Integer.
Scripting::ScriptArgumentGeneric< Boole > RefCountType
The type that maintains the Reference count for ScriptArgumentGeneric with be ScriptArgumentGen...
virtual Integer GetInteger() const
Get the Integer as a Integer.
virtual Real GetValue() const
Get the raw primitive to value.
A generic implementation of a ScriptArgument that is suitable for primitive types in most situations...
virtual void SetValue(Boole NewValue)
Provide an overload point to change assignment that operators will use.
A Null implementation of a ScriptArgument that is suitable for primitive types in most situations...
virtual Whole GetWhole() const
Get the Whole number.
virtual Integer GetInteger() const
Get the Argument as a Integer, slow default implementation.
virtual Integer GetTypeData() const
Get data about this being a Real number.
virtual Whole GetWhole() const
Get the Integer as a Whole.
virtual Integer GetInteger() const
Get the Whole as a Integer.
static RefCountType * ConstructionPointer(RefCountType *Target)
Given a pointer to the raw object this will return a pointer to an initialized reference count...
virtual void SetValue(Integer NewValue)
Provide an overload point to change assignment that operators will use.
virtual void SetValue(Whole NewValue)
Provide an overload point to change assignment that operators will use.
virtual ScriptArgumentGeneric< NullArgument > * GetMostDerived()
Get a pointer to the most Derived type of this class.
static RefCountType * ConstructionPointer(RefCountType *Target)
Given a pointer to the raw object this will return a pointer to an initialized reference count...
Scripting::iScriptArgument RefCountType
The type that maintains the Reference count for iScriptArgument with be iScriptArgument itself...
ScriptArgumentGeneric(String InitialValue)
Create an initialized Argument.
virtual Boole IsNull() const
Is this value representing a Null/Nil value.
The interface for a script argument.
Scripting::ScriptArgumentGeneric< String > RefCountType
The type that maintains the Reference count for ScriptArgumentGeneric with be ScriptArgumentG...
virtual Integer GetTypeData() const
Get data about this being a String.
virtual String GetString() const
Get the Argument as a String, slow default implementation.
std::string String
A datatype used to a series of characters.
virtual Boole GetBoole() const
Get the Bool.
virtual Boole GetBoole() const
Get as a Bool.
NullArgument Type
To make working with this easier.
static RefCountType * ConstructionPointer(RefCountType *Target)
Given a pointer to the raw object this will return a pointer to an initialized reference count...
virtual void SetValue(Real NewValue)
Provide an overload point to change assignment that operators will use.
virtual Whole GetWhole() const
Get the Real as a Whole.
Integer ToInteger(const T &Datum)
Converts whatever to an Integer as long as the proper streaming operators are available for it...
Whole ToWhole(const T &Datum)
Converts whatever to a Whole as long as the proper streaming operators are available for it...
virtual String GetString() const
Get Null as a String.