Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
FactoryParams Class Reference

An instance of this class is passed to the Factory when requesting it to do its business and construct a new something. More...

`#include "factoryParams.h"`

## Public Member Functions
| FactoryParams (const FactoryParams &copy)=default
| FactoryParams (FactoryParams &&from) noexcept=default
void | add_param (FactoryParam *param)
void | clear ()
| Removes all parameters from the set.
int | get_num_params () const
| Returns the number of parameters that have been added to the set.
FactoryParam * | get_param (int n) const
| Returns the nth parameter that has been added to the set.
FactoryParam * | get_param_of_type (TypeHandle type) const
| Returns the first parameter that matches exactly the indicated type, or if there are no exact matches, returns the first one that derives from the indicated type.
void * | get_user_data () const
| Returns the custom pointer that was associated with the factory function.
FactoryParams & | operator= (FactoryParams &&from) noexcept=default

## Friends
class | FactoryBase

## Detailed Description

An instance of this class is passed to the Factory when requesting it to do its business and construct a new something.

It can be filled with optional parameters to the CreateFunc for the particular subclass the Factory will be creating.

This is just a vector of pointers to *something*; it will be up to the individual CreateFuncs to interpret this meaningfully.

Definition at line 36 of file factoryParams.h.

## Member Function Documentation

## ◆ add_param()

void FactoryParams::add_param | ( | FactoryParam * | param | ) |

Definition at line 19 of file factoryParams.cxx.

## ◆ clear()

void FactoryParams::clear | ( |  | ) |

Removes all parameters from the set.

Definition at line 28 of file factoryParams.cxx.

## ◆ get_num_params()

int FactoryParams::get_num_params | ( |  | ) | const

Returns the number of parameters that have been added to the set.

Definition at line 36 of file factoryParams.cxx.

## ◆ get_param()

FactoryParam * FactoryParams::get_param | ( | int | n | ) | const

Returns the nth parameter that has been added to the set.

Definition at line 44 of file factoryParams.cxx.

Referenced by parse_params().

## ◆ get_param_of_type()

FactoryParam * FactoryParams::get_param_of_type | ( | TypeHandle | type | ) | const

Returns the first parameter that matches exactly the indicated type, or if there are no exact matches, returns the first one that derives from the indicated type.

If no parameters match at all, returns NULL.

Definition at line 55 of file factoryParams.cxx.

References TypedObject::is_exact_type(), and TypedObject::is_of_type().

Referenced by get_param_into().

## ◆ get_user_data()

void * FactoryParams::get_user_data | ( |  | ) | const
| inline

Returns the custom pointer that was associated with the factory function.

Definition at line 19 of file factoryParams.I.

## Friends And Related Symbol Documentation

## ◆ FactoryBase

friend class FactoryBase
| friend

Definition at line 61 of file factoryParams.h.

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

- panda/src/putil/factoryParams.h
- panda/src/putil/factoryParams.cxx
- panda/src/putil/factoryParams.I