Most simple CommandNode implementation. More...

#include <senf/Utils/Console/Node.hh>

Inheritance diagram for senf::console::SimpleCommandNode:

Public Types

typedef boost::shared_ptr< SimpleCommandNodeptr
 
typedef boost::shared_ptr< SimpleCommandNode const > cptr
 
typedef boost::weak_ptr< SimpleCommandNodeweak_ptr
 
typedef boost::function< void(std::ostream &, ParseCommandInfo const &)> Function
 
typedef SimpleCommandNode node_type
 
typedef SimpleCommandNodereturn_type
 
- Public Types inherited from senf::console::CommandNode
typedef boost::shared_ptr< CommandNodeptr
 
typedef boost::shared_ptr< CommandNode const > cptr
 
typedef boost::weak_ptr< CommandNodeweak_ptr
 
- Public Types inherited from senf::console::GenericNode
typedef boost::shared_ptr< GenericNodeptr
 
typedef boost::shared_ptr< GenericNode const > cptr
 
typedef boost::weak_ptr< GenericNodeweak_ptr
 

Public Member Functions

ptr thisptr ()
 
cptr thisptr () const
 
SimpleCommandNodedoc (std::string const &doc)
 
SimpleCommandNodeshortdoc (std::string const &doc)
 
- Public Member Functions inherited from senf::console::CommandNode
void execute (std::ostream &output, ParseCommandInfo const &command) const
 Execute the command. More...
 
void execute (boost::any &rv, std::ostream &output, ParseCommandInfo const &command) const
 Execute the command. More...
 
void operator() (std::ostream &output, ParseCommandInfo const &command) const
 Execute the command. More...
 
void operator() (boost::any &rv, std::ostream &output, ParseCommandInfo const &command) const
 
ptr thisptr ()
 
cptr thisptr () const
 
- Public Member Functions inherited from senf::console::GenericNode
virtual ~GenericNode ()
 
std::string const & name () const
 Node name. More...
 
boost::shared_ptr< DirectoryNodeparent () const
 Parent node. More...
 
std::string path () const
 Node path. More...
 
std::string path (DirectoryNode const &root) const
 Node path up to root. More...
 
ptr unlink ()
 Remove node from it's parent directory. More...
 
void rename (std::string const &newName)
 Rename node name in it's parent directory. More...
 
bool active () const
 true, if node is attached to the root() node More...
 
void help (std::ostream &output) const
 Write help info to output. More...
 
std::string shorthelp () const
 Get short (one-line) documentation. More...
 
ptr thisptr ()
 Get smart pointer to node. More...
 
cptr thisptr () const
 Get smart pointer to node (const) More...
 
bool isChildOf (DirectoryNode &parent) const
 true, if node is a child of parent More...
 
bool operator== (GenericNode &other) const
 true, if this and other are the same node More...
 
bool operator!= (GenericNode &other) const
 true, if this and other are different nodes More...
 
bool isDirectory () const
 true, if this is a directory node More...
 
bool isLink () const
 true, if this is a link node More...
 
bool isCommand () const
 true, if this is a command node More...
 
GenericNode const & followLink () const
 Follow link if this node is a link node. More...
 
GenericNodefollowLink ()
 Follow link if this node is a link node. More...
 

Protected Member Functions

 SimpleCommandNode (Function const &fn)
 
- Protected Member Functions inherited from senf::console::CommandNode
 CommandNode ()
 
- Protected Member Functions inherited from senf::console::GenericNode
 GenericNode ()
 
void name (std::string const &name)
 

Structors and default members

static ptr create (Function const &fn)
 

Detailed Description

Most simple CommandNode implementation.

This CommandNode implementation simply forwards the output and arguments arguments to an arbitrary callback. Thus, it allows to add callbacks with the signature

void callback(std::ostream & os, senf::console::ParseCommandInfo const & command)
{ ... }

to the tree.

Definition at line 635 of file Node.hh.

Member Typedef Documentation

◆ cptr

Definition at line 643 of file Node.hh.

◆ Function

typedef boost::function<void (std::ostream &, ParseCommandInfo const &)> senf::console::SimpleCommandNode::Function

Definition at line 646 of file Node.hh.

◆ node_type

◆ ptr

Definition at line 637 of file Node.hh.

◆ return_type

◆ weak_ptr

Definition at line 644 of file Node.hh.

Constructor & Destructor Documentation

◆ SimpleCommandNode()

senf::console::SimpleCommandNode::SimpleCommandNode ( Function const &  fn)
protected

Member Function Documentation

◆ create()

static ptr senf::console::SimpleCommandNode::create ( Function const &  fn)
static

◆ doc()

SimpleCommandNode& senf::console::SimpleCommandNode::doc ( std::string const &  doc)

◆ shortdoc()

SimpleCommandNode& senf::console::SimpleCommandNode::shortdoc ( std::string const &  doc)

◆ thisptr() [1/2]

ptr senf::console::SimpleCommandNode::thisptr ( )

◆ thisptr() [2/2]

cptr senf::console::SimpleCommandNode::thisptr ( ) const

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