PnContainer

Name

PnContainer -- base class for actuators that can contain other actuators

Synopsis


#include <pn/pn.h>


struct      PnContainer;
gboolean    pn_container_add_actuator       (PnContainer *container,
                                             PnActuator *actuator,
                                             gint position);
enum        PnContainerPosition;
void        pn_container_remove_actuator    (PnContainer *container,
                                             PnActuator *actuator);
void        pn_container_remove_all_actuators
                                            (PnContainer *container);

Object Hierarchy


  GObject
   +----PnObject
         +----PnUserObject
               +----PnActuator
                     +----PnContainer

Description

PnContainer is the base class for all actuators that can contain other actuators. How or when the contained actuators are executed is left to the subclass implimentation.

Details

struct PnContainer

struct PnContainer;


pn_container_add_actuator ()

gboolean    pn_container_add_actuator       (PnContainer *container,
                                             PnActuator *actuator,
                                             gint position);

Adds actuator to container. position is the zero-based index in the list of actuators that the newly added actuator should have, or it can be the value PN_POSITION_HEAD or PN_POSITION_TAIL.

container : a PnContainer
actuator : the PnActuator to add
position : the position at which to add the actuator
Returns : TRUE on success; FALSE on failure


enum PnContainerPosition

typedef enum
{
  PN_POSITION_TAIL = -1,
  PN_POSITION_HEAD = 0
} PnContainerPosition;


pn_container_remove_actuator ()

void        pn_container_remove_actuator    (PnContainer *container,
                                             PnActuator *actuator);

Removes the first occurence of actuator in container's list of contained actuators.

container : a PnContainer
actuator : the PnActuator to remove


pn_container_remove_all_actuators ()

void        pn_container_remove_all_actuators
                                            (PnContainer *container);

Removes all actuators from container's list of contained actuators.

container : a PnContainer