| GL Studio C++ Runtime API

Public Types | Static Public Member Functions | List of all members
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 Group * | AllMatchingNoChildren (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 | ) |
| inline static

Returns
  A group containing all of the matching children that are of the specified class.

Note
  Does not traverse sub groups.

Parameters

  grp | The object to check within.

## ◆ Call() [1/5]

static int Call | ( | DisplayObject * | obj,
|  | GlsColor_CallMethod_void | method,
|  | GlsColor & | foundColor
| ) |  |
| inline static

GlsColor Method(void)

Note
  This will not get the values from groups themselves, just their children.

Parameters

  obj | The object to locate, or group to search through.
  method | The function pointer to call on said object.
  foundColor | The 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
| ) |  |
| inline static

void Method(int)

Parameters

  obj | The object to locate, or group to search through.
  method | The function pointer to call on said object.
  arg1 | The 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
| ) |  |
| inline static

void Method(type,type)

Parameters

  obj | The object to locate, or group to search through.
  method | The function pointer to call on said object.
  arg1 | The first argument to pass through the function pointer.
  arg2 | The 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
| ) |  |
| inline static

void Method(int&)

Parameters

  obj | The object to locate, or group to search through.
  method | The function pointer to call on said object.
  arg1 | The 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
| ) |  |
| inline static

void Method()

Parameters

  obj | The object to locate, or group to search through.
  method | The function pointer to call on said object.

Returns
  True if one is found.

## ◆ Contained()

static bool Contained | ( | DisplayObject * | obj,
|  | DisplayObject * | findThis = `nullptr`
| ) |  |
| inline static

Just to see if the object contains one of T.

Parameters

  obj | The object to check within.
  findThis | An 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`
| ) |  |
| inline static

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

Parameters

  grp | The object to check within.
  findThis | An 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
| ) |  |
| inline static

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

  obj | The object to check within.
  n | The index to retrieve.

## ◆ GetNthRecurse()

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

Helper function for use with GetNth().

Parameters

  obj | The object to check within.
  n | The index to retrieve.

Returns
  The pointer to the object found, or NULL.

## ◆ GetValue()

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

T::variable

Parameters

  obj | The object to locate, or group to search through.
  variablePtr | The returned underlying storage of argType.
  foundValue | The 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`
| ) |  |
| inline static

int Method(void)

Parameters

  obj | The object to locate, or group to search through.
  method | The function pointer to call on said object.
  notFoundValue | The value to set if not found.
  multipleValue | The value to set if multiple values are found.
  rvalFoundOne | Used 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:

- traverser.h