23#ifndef __DIGITALCOMPONENT_HXX
24#define __DIGITALCOMPONENT_HXX 1
28#include <simgear/props/props.hxx>
29#include <simgear/props/condition.hxx>
40 SGPropertyNode_ptr _node;
66 _node->setBoolValue( node->getBoolValue() );
71 if( _node == NULL )
return false;
72 bool nodeState = _node->getBoolValue();
73 return _inverted ? !nodeState : nodeState;
78 if( _node == NULL )
return;
79 _node->setBoolValue( _inverted ? !value : value );
98 class InputMap :
public std::map<const std::string,SGSharedPtr<const SGCondition> >
106 typedef std::map<const std::string,DigitalOutput_ptr>
OutputMap;
132 virtual bool configure( SGPropertyNode& cfg_node,
133 const std::string& cfg_name,
134 SGPropertyNode& prop_root );
Component()
A constructor for an empty Component.
std::map< const std::string, DigitalOutput_ptr > OutputMap
OutputMap _output
Named output "pins".
bool _inverted
Global "inverted" flag for the outputs.
InputMap _input
Named input "pins".
virtual bool configure(SGPropertyNode &cfg_node, const std::string &cfg_name, SGPropertyNode &prop_root)
Over-rideable hook method to allow derived classes to refine top-level node parsing.
void setValue(bool value)
void setProperty(SGPropertyNode_ptr node)
void setInverted(bool value)
DigitalOutput()
Constructs an empty, noninverting output.
SGSharedPtr< DigitalOutput > DigitalOutput_ptr