CatapultServer  v0.5.0.1 (Elephant)
catapult::tools::NetworkCensusTool< TNodeInfo > Class Template Referenceabstract

A base class for a tool that performs a network census by communicating with all nodes. More...

Inheritance diagram for catapult::tools::NetworkCensusTool< TNodeInfo >:
Collaboration diagram for catapult::tools::NetworkCensusTool< TNodeInfo >:

Public Types

using NodeInfoPointer = std::shared_ptr< TNodeInfo >
 A node info shared pointer. More...
 
using NodeInfoFuture = thread::future< NodeInfoPointer >
 A node info shared pointer future. More...
 

Public Member Functions

 NetworkCensusTool (const std::string &censusName)
 Creates a census tool with census name (censusName). More...
 
std::string name () const override final
 Returns name of the command. More...
 
void prepareOptions (OptionsBuilder &optionsBuilder, OptionsPositional &positional) override final
 Prepare named (optionsBuilder) and positional options of the tool. More...
 
int run (const Options &) override final
 Run the tool passing options collected from the command line. More...
 
- Public Member Functions inherited from catapult::tools::Tool
virtual bool allowUnregisteredOptions () const
 Tool should return true if command line parser should allow unregistered options. More...
 
virtual CommandParsersubCommandParser (const Options &) const
 Tool should return sub command parser. More...
 
- Public Member Functions inherited from catapult::tools::CommandParser
virtual ~CommandParser ()=default
 

Private Member Functions

NodeInfoFuture createNodeInfoFuture (MultiNodeConnector &connector, const ionet::Node &node)
 
virtual std::vector< thread::future< bool > > getNodeInfoFutures (thread::IoThreadPool &pool, ionet::PacketIo &io, TNodeInfo &nodeInfo)=0
 Gets all futures to fill nodeInfo using pool and io. More...
 
virtual size_t processNodeInfos (const std::vector< NodeInfoPointer > &nodeInfos)=0
 Processes nodeInfos after all futures complete. More...
 

Private Attributes

std::string m_censusName
 
std::string m_resourcesPath
 

Detailed Description

template<typename TNodeInfo>
class catapult::tools::NetworkCensusTool< TNodeInfo >

A base class for a tool that performs a network census by communicating with all nodes.

Member Typedef Documentation

◆ NodeInfoFuture

template<typename TNodeInfo >
using catapult::tools::NetworkCensusTool< TNodeInfo >::NodeInfoFuture = thread::future<NodeInfoPointer>

A node info shared pointer future.

◆ NodeInfoPointer

template<typename TNodeInfo >
using catapult::tools::NetworkCensusTool< TNodeInfo >::NodeInfoPointer = std::shared_ptr<TNodeInfo>

A node info shared pointer.

Constructor & Destructor Documentation

◆ NetworkCensusTool()

template<typename TNodeInfo >
catapult::tools::NetworkCensusTool< TNodeInfo >::NetworkCensusTool ( const std::string &  censusName)
inlineexplicit

Creates a census tool with census name (censusName).

Member Function Documentation

◆ createNodeInfoFuture()

template<typename TNodeInfo >
NodeInfoFuture catapult::tools::NetworkCensusTool< TNodeInfo >::createNodeInfoFuture ( MultiNodeConnector connector,
const ionet::Node node 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNodeInfoFutures()

template<typename TNodeInfo >
virtual std::vector<thread::future<bool> > catapult::tools::NetworkCensusTool< TNodeInfo >::getNodeInfoFutures ( thread::IoThreadPool pool,
ionet::PacketIo io,
TNodeInfo &  nodeInfo 
)
privatepure virtual

Gets all futures to fill nodeInfo using pool and io.

Here is the caller graph for this function:

◆ name()

template<typename TNodeInfo >
std::string catapult::tools::NetworkCensusTool< TNodeInfo >::name ( ) const
inlinefinaloverridevirtual

Returns name of the command.

Implements catapult::tools::CommandParser.

◆ prepareOptions()

template<typename TNodeInfo >
void catapult::tools::NetworkCensusTool< TNodeInfo >::prepareOptions ( OptionsBuilder optionsBuilder,
OptionsPositional positional 
)
inlinefinaloverridevirtual

Prepare named (optionsBuilder) and positional options of the tool.

Implements catapult::tools::CommandParser.

◆ processNodeInfos()

template<typename TNodeInfo >
virtual size_t catapult::tools::NetworkCensusTool< TNodeInfo >::processNodeInfos ( const std::vector< NodeInfoPointer > &  nodeInfos)
privatepure virtual

Processes nodeInfos after all futures complete.

Here is the caller graph for this function:

◆ run()

template<typename TNodeInfo >
int catapult::tools::NetworkCensusTool< TNodeInfo >::run ( const Options options)
inlinefinaloverridevirtual

Run the tool passing options collected from the command line.

Implements catapult::tools::Tool.

Here is the call graph for this function:

Member Data Documentation

◆ m_censusName

template<typename TNodeInfo >
std::string catapult::tools::NetworkCensusTool< TNodeInfo >::m_censusName
private

◆ m_resourcesPath

template<typename TNodeInfo >
std::string catapult::tools::NetworkCensusTool< TNodeInfo >::m_resourcesPath
private

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