nndeploy C++ API  0.2.0
nndeploy C++ API
Public Member Functions | List of all members
nndeploy::dag::NodeDesc Class Reference

Node description class. More...

#include <node.h>

Public Member Functions

base::Status deserialize (const std::string &json_str)
 Deserialize from JSON string. More...
 
base::Status deserialize (rapidjson::Value &json)
 Deserialize from JSON. More...
 
std::vector< std::string > getInputs () const
 Get input edge name list. More...
 
std::string getKey () const
 Get node key. More...
 
std::string getName () const
 Get node name. More...
 
std::vector< std::string > getOutputs () const
 Get output edge name list. More...
 
base::Status loadFile (const std::string &path)
 Load from file. More...
 
 NodeDesc ()=default
 
 NodeDesc (const std::string &node_key, const std::string &node_name, std::initializer_list< std::string > inputs, std::initializer_list< std::string > outputs)
 Constructor. More...
 
 NodeDesc (const std::string &node_key, const std::string &node_name, std::vector< std::string > inputs, std::vector< std::string > outputs)
 Constructor. More...
 
 NodeDesc (const std::string &node_name, std::initializer_list< std::string > inputs, std::initializer_list< std::string > outputs)
 Constructor. More...
 
 NodeDesc (const std::string &node_name, std::vector< std::string > inputs, std::vector< std::string > outputs)
 Constructor. More...
 
base::Status saveFile (const std::string &path)
 Save to file. More...
 
std::string serialize ()
 Serialize to JSON string. More...
 
base::Status serialize (rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator)
 Serialize to JSON. More...
 
virtual ~NodeDesc ()=default
 

Detailed Description

Node description class.

Used to describe basic information of a node, including node name, input/output edge names, etc.

Definition at line 35 of file node.h.

Constructor & Destructor Documentation

◆ NodeDesc() [1/5]

nndeploy::dag::NodeDesc::NodeDesc ( )
default

◆ NodeDesc() [2/5]

nndeploy::dag::NodeDesc::NodeDesc ( const std::string &  node_name,
std::initializer_list< std::string >  inputs,
std::initializer_list< std::string >  outputs 
)
inline

Constructor.

Parameters
node_nameNode name
inputsInput edge name list
outputsOutput edge name list

Definition at line 45 of file node.h.

◆ NodeDesc() [3/5]

nndeploy::dag::NodeDesc::NodeDesc ( const std::string &  node_name,
std::vector< std::string >  inputs,
std::vector< std::string >  outputs 
)
inline

Constructor.

Parameters
node_nameNode name
inputsInput edge name vector
outputsOutput edge name vector

Definition at line 56 of file node.h.

◆ NodeDesc() [4/5]

nndeploy::dag::NodeDesc::NodeDesc ( const std::string &  node_key,
const std::string &  node_name,
std::initializer_list< std::string >  inputs,
std::initializer_list< std::string >  outputs 
)
inline

Constructor.

Parameters
node_keyNode key
node_nameNode name
inputsInput edge name list
outputsOutput edge name list

Definition at line 67 of file node.h.

◆ NodeDesc() [5/5]

nndeploy::dag::NodeDesc::NodeDesc ( const std::string &  node_key,
const std::string &  node_name,
std::vector< std::string >  inputs,
std::vector< std::string >  outputs 
)
inline

Constructor.

Parameters
node_keyNode key
node_nameNode name
inputsInput edge name vector
outputsOutput edge name vector

Definition at line 82 of file node.h.

◆ ~NodeDesc()

virtual nndeploy::dag::NodeDesc::~NodeDesc ( )
virtualdefault

Member Function Documentation

◆ deserialize() [1/2]

base::Status nndeploy::dag::NodeDesc::deserialize ( const std::string &  json_str)

Deserialize from JSON string.

Parameters
json_strJSON string
Returns
Operation status

◆ deserialize() [2/2]

base::Status nndeploy::dag::NodeDesc::deserialize ( rapidjson::Value &  json)

Deserialize from JSON.

Parameters
jsonJSON value object
Returns
Operation status

◆ getInputs()

std::vector<std::string> nndeploy::dag::NodeDesc::getInputs ( ) const
inline

Get input edge name list.

Returns
Input edge name vector

Definition at line 107 of file node.h.

◆ getKey()

std::string nndeploy::dag::NodeDesc::getKey ( ) const
inline

Get node key.

Returns
Node key

Definition at line 95 of file node.h.

◆ getName()

std::string nndeploy::dag::NodeDesc::getName ( ) const
inline

Get node name.

Returns
Node name

Definition at line 101 of file node.h.

◆ getOutputs()

std::vector<std::string> nndeploy::dag::NodeDesc::getOutputs ( ) const
inline

Get output edge name list.

Returns
Output edge name vector

Definition at line 113 of file node.h.

◆ loadFile()

base::Status nndeploy::dag::NodeDesc::loadFile ( const std::string &  path)

Load from file.

Parameters
pathFile path
Returns
Operation status

◆ saveFile()

base::Status nndeploy::dag::NodeDesc::saveFile ( const std::string &  path)

Save to file.

Parameters
pathFile path
Returns
Operation status

◆ serialize() [1/2]

std::string nndeploy::dag::NodeDesc::serialize ( )

Serialize to JSON string.

Returns
JSON string

◆ serialize() [2/2]

base::Status nndeploy::dag::NodeDesc::serialize ( rapidjson::Value &  json,
rapidjson::Document::AllocatorType &  allocator 
)

Serialize to JSON.

Parameters
jsonJSON value object
allocatorJSON allocator
Returns
Operation status

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