bpp-phyl3  3.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
bpp::NodePException Class Reference

General exception thrown when something is wrong with a particular node. More...

#include <Bpp/Phyl/Tree/TreeExceptions.h>

+ Inheritance diagram for bpp::NodePException:
+ Collaboration diagram for bpp::NodePException:

Public Member Functions

 NodePException (const std::string &text, const Node *node=0)
 Build a new NodePException. More...
 
 NodePException (const std::string &text, int nodeId)
 Build a new NodePException. More...
 
 NodePException (const NodePException &nex)
 
NodePExceptionoperator= (const NodePException &nex)
 
virtual ~NodePException ()
 
virtual const NodegetNode () const
 Get the node that threw the exception. More...
 
virtual int getNodeId () const
 Get the id of node that threw the exception. More...
 
const char * what () const noexcept override
 
const std::string & message () const noexcept
 

Protected Attributes

int nodeId_
 

Private Attributes

const Nodenode_
 
std::string message_
 

Detailed Description

General exception thrown when something is wrong with a particular node.

Definition at line 54 of file TreeExceptions.h.

Constructor & Destructor Documentation

◆ NodePException() [1/3]

NodePException::NodePException ( const std::string &  text,
const Node node = 0 
)

Build a new NodePException.

Parameters
textA message to be passed to the exception hierarchy.
nodeA const pointer toward the node that threw the exception.

Definition at line 15 of file TreeExceptions.cpp.

◆ NodePException() [2/3]

bpp::NodePException::NodePException ( const std::string &  text,
int  nodeId 
)
inline

Build a new NodePException.

Parameters
textA message to be passed to the exception hierarchy.
nodeIdThe id of the node that threw the exception.

Definition at line 73 of file TreeExceptions.h.

◆ NodePException() [3/3]

bpp::NodePException::NodePException ( const NodePException nex)
inline

Definition at line 76 of file TreeExceptions.h.

◆ ~NodePException()

virtual bpp::NodePException::~NodePException ( )
inlinevirtual

Definition at line 88 of file TreeExceptions.h.

Member Function Documentation

◆ getNode()

virtual const Node* bpp::NodePException::getNode ( ) const
inlinevirtual

Get the node that threw the exception.

Returns
A pointer toward the faulty node.

Definition at line 96 of file TreeExceptions.h.

References node_.

◆ getNodeId()

virtual int bpp::NodePException::getNodeId ( ) const
inlinevirtual

Get the id of node that threw the exception.

Returns
The id of the faulty node.

Reimplemented from bpp::NodeException.

Definition at line 102 of file TreeExceptions.h.

References bpp::NodeException::nodeId_.

◆ operator=()

NodePException& bpp::NodePException::operator= ( const NodePException nex)
inline

Definition at line 81 of file TreeExceptions.h.

References node_.

Member Data Documentation

◆ node_

const Node* bpp::NodePException::node_
private

Definition at line 58 of file TreeExceptions.h.

Referenced by getNode(), and operator=().

◆ nodeId_

int bpp::NodeException::nodeId_
protectedinherited

Definition at line 27 of file TreeExceptions.h.

Referenced by bpp::NodeException::getNodeId(), and getNodeId().


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