GL Studio C++ Runtime API
TraverseGroup< T, argType, arg2Type > Class Template Reference

#include <traverser.h>

Public Types

typedef void(T::* void_CallMethod_void) ()
 Typedef for a function pointer with no arguments or return value.
 
typedef void(T::* void_CallMethod_argType) (argType)
 Typedef for a function pointer taking one argument and no return value.
 
typedef void(T::* void_CallMethod_argType_arg2Type) (argType, arg2Type)
 Typedef for a function pointer taking two arguments and no return value.
 
typedef void(T::* void_CallMethod_argTypeRef) (argType &)
 Typedef for a function pointer taking one argument as a reference, no return value.
 
typedef argType(T::* argType_CallMethod_void) ()
 Typedef for a function pointer with no arguments, and has a return value.
 
typedef GlsColor(T::* GlsColor_CallMethod_void) ()
 Typedef for a function pointer that has no arguments, and returns a GlsColor.
 

Static Public Member Functions

static bool Contained (DisplayObject *obj, DisplayObject *findThis=nullptr)
 
static bool ContainedNoChildren (Group *grp, DisplayObject *findThis=nullptr)
 
static GroupAllMatchingNoChildren (Group *grp)
 
static T * GetNth (DisplayObject *obj, const int n)
 
static T * GetNthRecurse (DisplayObject *obj, int &n)
 
static Traverse::ResultEnum GetValue (DisplayObject *obj, argType T::*variablePtr, argType &foundValue)
 
static bool Call (DisplayObject *obj, void_CallMethod_void method)
 
static bool Call (DisplayObject *obj, void_CallMethod_argType method, const argType arg1)
 
static bool Call (DisplayObject *obj, void_CallMethod_argType_arg2Type method, argType arg1, arg2Type arg2)
 
static bool Call (DisplayObject *obj, void_CallMethod_argTypeRef method, argType &arg1)
 
static argType ReturnCall (DisplayObject *obj, argType_CallMethod_void method, const argType notFoundValue=argType(0), const argType multipleValue=argType(-1), bool *rvalFoundOne=nullptr)
 
static int Call (DisplayObject *obj, GlsColor_CallMethod_void method, GlsColor &foundColor)
 

Detailed Description

template<class T, class argType = int, class arg2Type = int>
class disti::TraverseGroup< T, argType, arg2Type >

The TraverseGroup class

Member Function Documentation

◆ AllMatchingNoChildren()

static Group * AllMatchingNoChildren ( Group grp)
inlinestatic
Returns
A group containing all of the matching children that are of the specified class.
Note
Does not traverse sub groups.
Parameters
grpThe object to check within.

◆ Call() [1/5]

static int Call ( DisplayObject obj,
GlsColor_CallMethod_void  method,
GlsColor foundColor 
)
inlinestatic

GlsColor Method(void)

Note
This will not get the values from groups themselves, just their children.
Parameters
objThe object to locate, or group to search through.
methodThe function pointer to call on said object.
foundColorThe returned located color.
Returns
0 if not found. Returns -1 if multiple values are found. Returns 1 if a single value is found.

◆ Call() [2/5]

static bool Call ( DisplayObject obj,
void_CallMethod_argType  method,
const argType  arg1 
)
inlinestatic

void Method(int)

Parameters
objThe object to locate, or group to search through.
methodThe function pointer to call on said object.
arg1The argument to pass through the function pointer.
Returns
true If one is found.

◆ Call() [3/5]

static bool Call ( DisplayObject obj,
void_CallMethod_argType_arg2Type  method,
argType  arg1,
arg2Type  arg2 
)
inlinestatic

void Method(type,type)

Parameters
objThe object to locate, or group to search through.
methodThe function pointer to call on said object.
arg1The first argument to pass through the function pointer.
arg2The second argument to pass through the function pointer.
Returns
True if one is found.

◆ Call() [4/5]

static bool Call ( DisplayObject obj,
void_CallMethod_argTypeRef  method,
argType &  arg1 
)
inlinestatic

void Method(int&)

Parameters
objThe object to locate, or group to search through.
methodThe function pointer to call on said object.
arg1The argument to pass through the function pointer.
Returns
True if one is found.

◆ Call() [5/5]

static bool Call ( DisplayObject obj,
void_CallMethod_void  method 
)
inlinestatic

void Method()

Parameters
objThe object to locate, or group to search through.
methodThe function pointer to call on said object.
Returns
True if one is found.

◆ Contained()

static bool Contained ( DisplayObject obj,
DisplayObject findThis = nullptr 
)
inlinestatic

Just to see if the object contains one of T.

Parameters
objThe object to check within.
findThisAn optional specific object to check for.
Returns
If findThis is NULL, will return true if any one is found. If findThis has a value, will return true only if findThis is found.

◆ ContainedNoChildren()

static bool ContainedNoChildren ( Group grp,
DisplayObject findThis = nullptr 
)
inlinestatic

Like Contained(), but looks only one level deep.

Parameters
grpThe object to check within.
findThisAn optional specific object to check for.
Returns
If findThis is NULL, will return true if any one is found. If findThis has a value, will return true only if findThis is found.

◆ GetNth()

static T * GetNth ( DisplayObject obj,
const int  n 
)
inlinestatic
Returns
The nth object (1 is the first) of the template type in the specified selections. The value of n will be decremented to zero if found. return Value will be NULL if not found.
Parameters
objThe object to check within.
nThe index to retrieve.

◆ GetNthRecurse()

static T * GetNthRecurse ( DisplayObject obj,
int &  n 
)
inlinestatic

Helper function for use with GetNth().

Parameters
objThe object to check within.
nThe index to retrieve.
Returns
The pointer to the object found, or NULL.

◆ GetValue()

static Traverse::ResultEnum GetValue ( DisplayObject obj,
argType T::*  variablePtr,
argType &  foundValue 
)
inlinestatic

T::variable

Parameters
objThe object to locate, or group to search through.
variablePtrThe returned underlying storage of argType.
foundValueThe returned value of the underlying storage of argType.
Returns
The ResultEnum found state for the object.

◆ ReturnCall()

static argType ReturnCall ( DisplayObject obj,
argType_CallMethod_void  method,
const argType  notFoundValue = argType( 0 ),
const argType  multipleValue = argType( -1 ),
bool *  rvalFoundOne = nullptr 
)
inlinestatic

int Method(void)

Parameters
objThe object to locate, or group to search through.
methodThe function pointer to call on said object.
notFoundValueThe value to set if not found.
multipleValueThe value to set if multiple values are found.
rvalFoundOneUsed for recursion.
Note
This will not get the values from groups themselves, just their children.
Returns
notFoundValue If not found. returns multipleValue If multiple values are found.

The documentation for this class was generated from the following file: