// Switch.H: Switch nodes.

// This file has been generated using nodegen 0.5a.
// Restrict manual editing to the sections delimited by
// . the comments "utility includes" and "end of utility includes"
// . the comments "utility members" and "end of utility members"

#ifndef _Switch_H_
#define _Switch_H_

#include "xrml.H"
#include "Grouping.H"
#include "Children.H"

// utility includes
// end of utility includes

namespace xrml {
#define SwitchTypeId 	"Switch"
extern bool IsSwitch(SFNode*);

class Switch: public virtual SFNode, public Grouping, public Children {
private:
  //
  void clone_here(const Switch&);
  void destruct(void);
  
  // field/eventOut update status bits
  // Use xxx_is_updated() and xxx_clear_update() to inspect/reset.
  enum status_bits {
    choice_updated = 0x1,
    whichChoice_updated = 0x2 
  };
  
protected:
  // raw children nodes (can be PROTO) + synchronize methods:
  MFNode 	_choice;
  void 	synchronize_choice(void);

public:
  //
  int major_version(void), minor_version(void);
  bool is_leaf_class(void);
  
  Switch();
  Switch(const Switch&);
  Switch& operator=(const Switch&);
  virtual ~Switch();
  
  //
  SFNode*          	instantiate(Proto * =0);
  void             	render(void);
  
  // state values:
  // Do not assign directly unless you know very well what you are doing.
  array<Children*> 	choice;
  SFInt32          	whichChoice;
  
  // set_<exposedField> eventIns: with forwarding and eventOut generation
  void             	set_choice(const MFNode&);
  void             	set_whichChoice(const SFInt32&);
  
  // field assignement: no forwarding or eventOut generation!
  bool             	assign_choice(const MFNode&);
  bool             	assign_whichChoice(const SFInt32&);
  
  // update status
  inline bool      	choice_is_updated(void) { return (status & choice_updated); }
  inline void      	choice_clear_update(void) { status &= ~choice_updated; }
  inline bool      	whichChoice_is_updated(void) { return (status & whichChoice_updated); }
  inline void      	whichChoice_clear_update(void) { status &= ~whichChoice_updated; }
  
  // utility members
  
protected:
  inline void util_init(void) { }
  inline void util_clone(const Switch& src) { }
  inline void util_destruct(void) { }
};

// end of utility members
} // namespace xrml
#endif /*_Switch_H_*/
