Core Interface#

class Sample#

Sample is a collection of data that meet one of the definition of sample properties, a sample contains its own ID, input images and all the output data obtained by the input images after the tool processing.

Public Functions

explicit Sample(std::map<std::string, std::string> property_name_types)#

Construct a new Sample object with the property name-type map.

Parameters:

property_name_types – The property name-type map.

const std::map<std::string, std::string> &property_types() const#

Get the property name-type name.

Returns:

std::map<std::string, std::string> const& The property name-type map.

const std::string &property_type(const std::string &property_name) const#

Get the property type specified by the name.

Parameters:

property_name – The property name.

Returns:

std::string The property type.

bool exist_property_name(const std::string &property_name) const#

Check if the property name is valid or not in the sample.

Parameters:

property_name – The property name.

Returns:

bool True if the property name is valid, otherwise false.

bool exist_property_data(const std::string &property_name) const#

Check if property data exists in the sample.

Parameters:

property_name – The property name.

Returns:

bool True if the property data exists, otherwise false.

const std::shared_ptr<props::IProperty> &get(const std::string &property_name) const#

Get the property specified by the name.

This function will return nullptr if the property data is not set, or an exception will be thrown if the property name is invalid.

Parameters:

property_name – The property name.

Throws:

excepts::InvalidArgument – The property name not exist in the sample.

Returns:

std::shared_ptr<props::IProperty> The property.

void set(const std::string &property_name, const std::shared_ptr<props::IProperty> &property)#

Set the property data specified by the name.

Note

The property data will not be copied, any change to the property data will be reflected in the sample after the call.

Parameters:
  • property_name – The property name.

  • property – The property data. The property data must be the same type as the property type.

Throws:

excepts::InvalidArgument – The property name not exist in the sample or the type of the property data is not the same as the property type in the sample.

std::shared_ptr<props::IProperty> &get_or_create(const std::string &property_name)#

Get the property data specified by the name. Defferent from get, If the property data is not set, this function will try to create the property data by the property type.

Parameters:

property_name – The property name.

Throws:

excepts::InvalidArgument – The property name not exist in the sample.

Returns:

std::shared_ptr<props::IProperty> The property data.

SampleDescriptor &descriptor()#

Get the sample descriptor.

Returns:

SampleDescriptor& The sample descriptor.

const SampleDescriptor &descriptor() const#

Get the sample descriptor.

Returns:

SampleDescriptor const& The sample descriptor.

struct SampleDescriptor#

Sample descriptor to describe the sample’s attributes, including tags, created time, etc.

class Project#

Project is a unit of work and data management built to complete an actual defect inspect process. A project contains the process pipeline and data such as backup data and report data created for that stream.

Public Functions

std::string add_tool(const std::string &tool_type, const std::string &tool_id = "")#

Get the descriptor of this project.

Add a new tool into the stream graph.

Parameters:
  • tool_type – The type of the tool to be added.Available tool_type is offered by ToolFactory

  • tool_id – The id of the tool to be added. It should be unique in the stream graph if you want to name it, otherwise an excepts::ToolAlreadyExist will be thrown. Or you can use the default argument (an empty string) to let the system generate a unique id automatically.

Throws:
Returns:

ProjectDescriptor of this project.

Returns:

The id of the tool added.

void connect(const ToolNodeId &upstream, const ToolNodeId &downstream)#

Connect two tools together by connecting the output data anchor of the first tool (from_tool) to the input data anchor of the second tool (to_tool).

To connect two tools, You must follow the following rules:

  1. The two tools must have been added into the stream graph before, and The output data anchor and input data anchor should be exist in the first tool and the second tool respectively. otherwise excepts::ToolNotFound or excepts::NodeNotFound will be thrown.

  2. The two tools should have different ids, and there is no direct or indirect connection from the second tool to the first tool, otherwise an excepts::LoopConnection will be thrown.

  3. The connect type of the output data anchor of the first tool must be DataEdge::kMarkedOutput, and the input data anchor of the second tool must be DataEdge::kVirtualInput, and the two nodes must be data nodes , otherwise an excepts::InvalidConnection will be thrown. see DataEdge::connect_type for more details.

  4. the provided features of the output data anchor of the first tool should be matched the required features of the input data anchor of the second tool, and the output data anchor of the first tool and the input data anchor of the second tool should have same cpt_tag, otherwise an excepts::DataTypeMismatch will be thrown.

  5. An output data anchor of a tool can connect to multiple input data anchors of other tools, but an input data anchor can only be connected to a single output data anchor. So it will be reset and reconnected if the input data anchor is already connected to another output data anchor and no exception is thrown.

ToolNodeId is a class that contains tool_id and node_id.

Note

Idempotence. Making multiple identical call has the same effect as making a single call .

Parameters:
  • upstream – The ToolNodeId of the output data anchor to be connected.

  • downstream – The ToolNodeId of the input data anchor to be connected.

Throws:
void disconnect(const ToolNodeId &tool_node)#

Disconnect the node of tool from its upstream tool.

Note

if the connection doesn’t exist, no error would occur.

Parameters:

tool_node – a ToolNodeId object specifying the node

Throws:
void remove_tool(const std::string &tool_id, bool remove_all_depends_on_this = false)#

Remove tool. All connections related to the tool will be disconnected.If no such a tool in stream graph, no error would occur.

Parameters:
  • tool_id – The id of the tool to be removed.

  • remove_all_depends_on_this – If true, all the tools that depends on the tool to be removed will be removed as well, default is false.

ToolInfo tool_info(const std::string &tool_id) const#

Get the tool info object according to tool id.

Parameters:

tool_id – Identifier of the tool added to project

Throws:

excepts::ToolNotFound – If the tool id is not found.

Returns:

ToolInfo

std::vector<std::string> tool_list() const#

Get the all tools added to project.

Returns:

std::vector<std::string> Identifiers of tools

std::map<std::string, std::string> all_properties_name_type() const#

Get the descriptor of this project.

Get the name and type of all properties in SampleSet

Returns:

ProjectDescriptor of this project.

Returns:

a map with pair of property name and property type

std::vector<std::string> sample_sets_names() const#

Get names of all samplesets.

Returns:

std::vector<std::string> all sampleset names in this project

void add_sample_set(const std::string &name)#

Add a new sampleset into project.

Throws:

excepts::DatasetAlreadyExists – If name is empty or a sampleset with specified name already exists

Parameters:

name

SampleSet get_sample_set(const std::string &name)#

Get sampleset with specified name.

Note

SampleSet keep the reference of data in the project, therefore it should never be used beyond the lifetime of Project.

Parameters:

name – name of sampleset

Throws:

excepts::DatasetNotExists – if no such a sampleset

Returns:

SampleSet

ReadOnlySampleSet get_readonly_sample_set(const std::string &name) const#

Get ReadonlySampleSet which include all samples of the project.

Note

ReadOnlySampleSet keep the reference of data in the project, therefore it should never be used beyond the lifetime of Project.

Parameters:

name – name of sampleset

Throws:

excepts::DatasetNotExists – if no such a sampleset

Returns:

ReadOnlySampleSet

std::string main_sample_set_name() const#

Get the main sampleset name.

Returns:

NO_DISCARD std::string name

SampleSet main_sample_set()#

Get the main sampleset.

Returns:

NO_DISCARD SampleSet

ReadOnlySampleSet readonly_main_sample_set() const#

Get the readonly main sampleset.

Returns:

NO_DISCARD SampleSet

void rename_sampleset(const std::string &old_name, const std::string &new_name)#

Rename sampleset.

Parameters:
  • old_name

  • new_name

void remove_sample_set(const std::string &name)#

remove sampleset and the data in it will be unrecoverable

Note

main sampleset is not allowed to remove

Throws:

excepts::LogicError – Can not remove main dataset

Parameters:

name

Runtime create_runtime(const aidi::strategy::IStrategy &strategy)#

Create a runtime object.

Parameters:

strategy – RuntimeStratey which specify the scope to be executed in stream graph.

Returns:

Runtime

void set_param(const ToolNodeId &tool_node, const aidi::param::IParameter &param)#

Set the param object.

Parameters:
  • tool_nodeToolNodeId specifying the node of the tool

  • param

aidi::Buffer get_context(const ToolNodeId &tool_node) const#

Get the context object.

Parameters:

tool_nodeToolNodeId specifying the node of the tool

Returns:

aidi::Buffer

void set_context(const ToolNodeId &tool_node, const aidi::Buffer &context)#

Set the context object.

Parameters:
  • tool_nodeToolNodeId specifying the node of the tool

  • context – the node context

std::shared_ptr<aidi::param::IParameter> get_param(const ToolNodeId &tool_node) const#

Get the param object of specified tool and node.

Parameters:

tool_nodeToolNodeId specifying the node of the tool

Returns:

std::shared_ptr<aidi::param::IParameter>

std::vector<std::string> backup_ids() const#

Get all backup ids.

Returns:

std::vector<std::string> The id of backups.

std::string create_backup()#

Make an overall backup of the Project.

Throws:
Returns:

std::string The ID of the backup version.

void restore_backup(const std::string &backup_id)#

Restore a version backup and all its associated data.

Parameters:

backup_id – The ID of the backup version.

Throws:
void remove_backup(const std::string &backup_id)#

Remove the version backup and all its associated data.

Parameters:

backup_id – The ID of the backup version.

Throws:

Public Static Functions

static bool Exists(const ProjectDescriptor &proj_desc)#

Check whether a project exists.

Parameters:

proj_desc – the project descriptor

Returns:

true

Returns:

false

static bool ReadProjectDescriptorFromProject(ProjectDescriptor &proj_desc)#

Read the ProjectDescriptor.

Parameters:

proj_desc – project descriptor with workspace_token as project_name specified

Returns:

true if Project exist and proj_desc field will update with project information

Returns:

false Fail to read project information, and proj_desc won’t update

static ProjectDescriptor Create(const ProjectDescriptor &proj_desc)#

Create project.

Parameters:

proj_desc – Descriptor specifying the parent path and name of the project

Throws:

excepts::FileExisted – if project already existed

Returns:

ProjectDescriptor of created project (not open yet)

static std::unique_ptr<Project> Open(const ProjectDescriptor &proj_desc)#

Open project.

Parameters:

proj_desc – project descriptor specifiy the parent path and name of the project

Throws:

excepts::FileNotFound – if no such a project

Returns:

std::unique_ptr<Project>

class WorkSpace#

that manages a list of projects.

Public Functions

explicit WorkSpace(const std::string &token)#

WorkSpace unique constructor.

Parameters:

token – The token of the workspace (cloud: URL, local: directory), should be UTF-8 encoding

std::string get_workspace_token() const#

Create a new project.

Open a project in this workspace.

Get the token of the workspace.

Parameters:
  • project_name – The name of the project.

  • remark – Remarks(optional).

  • project_name – the name of the project.

Returns:

std::unique_ptr<Project> of the project.

Returns:

std::unique_ptr<Project> std::unique_ptr<Project> of the project.

Returns:

std::string the token of the worksapce.

std::vector<ProjectDescriptor> project_descriptors() const#

Get all project descriptor in the workspace. If the workspace is not exists or mepty, the vector would be empty.

Returns:

std::vector<ProjectDescriptor> all project descriptor in the workspace.

void remove_project(const ProjectDescriptor &project_descriptor)#

Remove a project from the workspace, throws an exception if the project is open.

Parameters:

project_descriptor

ProjectDescriptor copy_project(const ProjectDescriptor &source_project_descriptor, const std::string &new_name, const std::string &remark)#

Copy a project from another workspace to the current workspace, Can be local to local, cloud to cloud, local to cloud, cloud to local.

Parameters:
  • source_project_descriptorProjectDescriptor of the source project.

  • new_name – The name of the new project, if it is empty, it defaults to “source_project_name + .copy”.

  • remark – Remarks (optional).

Returns:

ProjectDescriptor of the new project.

struct ProjectDescriptor#

ProjectDescriptor.

Public Members

std::string workspace_token#

The workspace token which you can get with WorkSpace::get_workspace_token()

std::string project_name#

project name.

std::string remark#

User-defined project information which users can use it to express any project-related descriptive information.

std::string sdk_version#

SDK version used last time to open the project. This field is readonly and can only be set by the sdk, which means it’s not useful if you set it when you create a project.

std::string created_time#

Time to create the project.

std::string last_modified_time#

The last modification time of the project.

class DataEdge#

DataEdge interface class.

A tool consists of nodes and edges. The edges are the data flow between nodes, and the nodes are the data processing units. Our data would be two types of data: parameters used to configure the data processing units, and properties of a Sample generated by the data processing units.

See also

ComputeNode

Public Types

enum DataCptTag#

The concept type of the data edge. It can be a parameter or a property.

Values:

enumerator kParam#

Parameter type.

enumerator kProp#

Property type.

enum ConnectType#

The connect type of the data edge.

The connection relationship of the data edges in the tool may be one of the following three cases:

  1. The data is an input of the tool, which means the data is generated by other tool and is used as an input of the tool. The actual data represented by the data edge does not belong to this tool, so we mark it as a “virtual input”.

  2. The data is an output of the tool, which means the data is generated by this tool and will be used by other tools, We mark it as an “output” of this tool.

  3. The data is generated in this tool and only used in this tool and will be used by other tools, so we mark it as a “internal” data.

Values:

enumerator kVirtualInput#

Virtual input.

enumerator kMarkedOutput#

Output of this tool.

enumerator kInternal#

Internal data.

Public Functions

std::string id() const#

Get data id in the tool.

Returns:

std::string The data id.

std::string type() const#

Get the data type of the data edge.

Returns:

std::string The type of the data edge.

int64_t last_update_time() const#

Get last modified time of the data edge.

Returns:

int64_t The last modified time of the data edge in utc timestamp.

DataCptTag cpt_tag() const#

Get concept type of the data edge, which can be a parameter or a property.

See also

DataCptTag

Returns:

DataCptTag The concept type of the data edge.

ConnectType connect_type() const#

Get the connect type of the data edge.

See also

ConnectType

Returns:

ConnectType The connect type of the data edge.

std::pair<std::string, std::string> redirect_to() const#

Get the data edge’s source node id if the data edge is a “virtual

input” data edge.

This function is only valid when the data edge is a “virtual

input” data edge and the “virtual input” data edge has been connected to a “output” data edge in another tool. If the data edge is not a “virtual

input” data edge, you will get an empty tool id, and if the data edge is a “virtual input” but not connected to any “output” data edge in another tool, you will get both empty tool id and empty data id.

Returns:

std::pair<std::string, std::string> The source tool id and source node id.

std::vector<ComputeNode> generated_by() const#

Get compute nodes that can generate the given data edge.

Note

As the data edge may be generated by multiple compute nodes although only one compute node will be executed at the same time, the size of the returned vector is not guaranteed to be 1. But in most cases, it is 1.

Returns:

std::vector<ComputeNode> Compute nodes that can generate the given data edge.

std::vector<ComputeNode> used_by() const#

Get compute nodes that use the given data edge.

Note

As the data edge may be used by multiple compute nodes, the size of the returned vector is not guaranteed to be 1.

Returns:

std::vector<ComputeNode> Compute nodes that use the given data edge.

class ComputeNode#

ComputeNode Info.

Compute nodes are the core data processing units in the tool. a compute node will reveive parameters and properties generated by other compute nodes and process the data to generate new parameters or properties.

See also

DataEdge

Public Types

enum ComputeCptTag#

The concept type of the compute node. It can be a operator to generate properties or a configurator to generate parameters.

Values:

enumerator kConf#

Configurator type.

enumerator kOper#

Operator type.

Public Functions

std::string id() const#

Get compute node id in the tool. The compute node id is unique in a tool.

Returns:

std::string The compute node id.

std::string type() const#

Get the compute node type of the compute node.

Returns:

std::string The type of the compute node.

int64_t last_update_time() const#

Get last modified time of the compute node in utc timestamp.

Returns:

int64_t The last modified time of the compute node in utc timestamp.

std::vector<DataEdge> param_nodes() const#

Get parameter edges required by the compute node.

The parameter edges are the data edges that are used to configure the compute node.

Returns:

std::vector<DataNode> The parameter edges required by the compute node, all concept type of the data edges returned are kParam.

std::vector<DataEdge> input_nodes() const#

Get property edges required by the compute node.

Returns:

std::vector<DataEdge> The property edges required by the compute node, all concept type of the data edges returned are kProp.

std::vector<DataEdge> output_nodes() const#

Get data edges generated by the compute node.

The data edges are the data edges that are generated by the compute node. If the compute node is a configurator, the generated data edges are parameters. If the compute node is an operator, the generated data edges are properties.

Returns:

std::vector<DataEdge> The data edges generated by the compute node. All concept type of the data edges returned are kParam or kProp according to the compute node’s concept type.

ComputeCptTag cpt_tag() const#

Get the compute node’s concept type.

Returns:

ComputeCptTag The concept type of the compute node.

class ToolInfo#

ToolInfo is a class that provides information about the tool.

Public Functions

std::string id() const#

Get tool id in the tool graph.

Returns:

std::string The tool id.

std::string type() const#

Get the tool type of the tool graph.

Returns:

std::string The type of the tool.

std::vector<DataEdge> input_edges() const#

Get virtual input data edges of the tool.

Returns:

std::vector<DataEdge> virtual input data edges of the tool. All the connect type of the data edges returned are kVirtualInput.

std::vector<DataEdge> output_edges() const#

Get output data edges of the tool.

Returns:

std::vector<DataEdge> output data edges of the tool. All the connect type of the data edges returned are kMarkedOutput.

std::vector<DataEdge> data_edges() const#

Get all data Egdes in the tool.

Returns:

std::vector<DataEdge> All data edges in the tool.

std::vector<ComputeNode> compute_nodes() const#

Get all compute nodes in the tool.

Returns:

std::vector<ComputeNode> All compute nodes in the tool.

class ToolNodeId#

Public Functions

ToolNodeId(std::string tool_id, std::string node_id)#

Construct a new Tool Node Id object with tool name and node name.

Parameters:
  • tool_id – Tool name.

  • node_id – Node name, which should not contain ‘/’.

Throws:

aidi::excepts::InvalidNodeId – If the node name is invalid.

ToolNodeId(const std::string &concat_id)#

Construct a new Tool Node Id object with concated tool name and node name with ‘/’.

Parameters:

concat_id – Tool name and node name concated with ‘/’.

const std::string &tool_id() const#

Get the tool name.

Returns:

const std::string&

const std::string &node_id() const#

Get the node name.

Returns:

const std::string&

std::string concat_id() const#

Get the concated tool name and node name with ‘/’.

Returns:

std::string

Public Static Functions

static bool IsValidNodeId(const std::string &node_id, std::string *err_msg = nullptr)#

Check if the node name is valid.

Parameters:
  • node_id – Node name.

  • err_msg – Error message if the node name is invalid, otherwise empty.

Returns:

true If the node name is valid.

Returns:

false If the node name is invalid.

class Runtime#

Runtime handle. It’s used to manage list of operator’s runtime. With this handle, user can inference samples without knowing the graph details of the stream and property details of the sample.

Public Functions

Sample create_sample() const#

Create a sample meeting the runtime’s properties requirements.

Returns:

Sample Created sample.

const PropIDTypeMap &required_properties() const#

Get the names and types of all properties required by the runtime.

Returns:

PropIDTypeMap All properties’s name-type map.

const PropIDTypeMap &input_properties() const#

Get the names and types of input properties required by the runtime.

Returns:

PropIDTypeMap Input properties’ name-type map.

const PropIDTypeMap &all_output_properties() const#

Get all output properties’ names and types.

Returns:

PropIDTypeMap Output properties’ name-type map.

const PropIDTypeMap &virtual_output_properties() const#

Get virtual output properties’ names and types.

“Virtual output” means the output property that cannot generate by runtime as the operator to generate it is an virtual operator and can not be run automatically. “Virtual output” should be set into the sample by user before you execute the sample, the virtual operator vill only check if it’s meets the parameter requirements and throw an exception if it’s not.

Note

As the virtual output property can not generate by runtime automatically, and user also can not set it whitout it’s dependency properties which should be generated by runtime automatically, so we stipulate that in a runtime, virtual output properties cannot depend on other output properties, but only on input properties and other virtual properties, otherwise an exception will be thrown when create runtime.

Returns:

PropIDTypeMap The virtual output properties’s name-type map.

const PropIDTypeMap &final_output_properties() const#

Get final output properties’s names and types.

Returns:

PropIDTypeMap Final output properties’s name-type map.

bool is_meeting_requirement(const Sample &sample, std::string *error_message = nullptr) const#

Check if sample meets the runtime’s requirement.

Parameters:
  • sampleSample to be checked.

  • error_message[out] Error message if the sample does not meet the runtime requirement. If the sample meets the runtime requirement, this will be an empty string.

Returns:

bool True if the sample meets the runtime requirement, false if not.

void execute(Sample &sample) const#

Inference a sample, generate output properties from input properties in the sample, and check if virtual input properties meets the parameter requirements.

Note

Do not call this function in different threads at the same time.

Parameters:

sample[inout] The sample to be inferred, should contains all properties required by the runtime. You can create the sample by calling create_sample and set required input properties into it.

class RuntimeSampleSetAdapter#

Adapter class to adapt a sample set to a runtime.

The adapter will filter out all samples that are not meeting the runtime requirements, and will only read properties that are required by the runtime or write properties output by the runtime. Other properties not related to the runtime will be ignored unless you force write them by calling the update_all_related() method.

Public Types

using Iterator = SampleSetRuntimeAdapterIterator#

Iterator type to iterate all samples in the sample set.

Public Functions

RuntimeSampleSetAdapter(SampleSet *sample_set, const Runtime &runtime)#

Construct a new Sample Set Runtime Adapter object.

Note

The Adapter will reference the Sample Set during its life cycle, and you should make sure the adapter will be destroyed before the Sample Set.

Parameters:
  • sample_set – The Sample Set to adapt.

  • runtime – The Runtime to adapt to.

Iterator begin() const#

Get begin iterator to iterate all samples meeting the runtime’s requirements.

Throws:

excepts::SampleNotFound – throws if no sample meets the runtime’s requirements.

Returns:

const RuntimeSampleSetAdapter::Iterator

Iterator end() const#

Get end iterator.

Throws:

excepts::SampleNotFound – throws if no sample meets the runtime’s requirements.

Returns:

const RuntimeSampleSetAdapter::Iterator

Sample get(const Iterator &iter) const#

Get the sample where the iterator is pointing to.

This method is only valid when the iterator is pointing to a valid sample, and will only return a sample only contains the input properties required by the runtime. If you want to retrieve the sample with all properties in the sample set, please use get_all_related() instead.

Parameters:

iter – The iterator to get the sample from.

Throws:

excepts::InvalidIterator – throws if the iterator is point to an empty sample or the sample does not meet the runtime’s requirements.

Returns:

Sample The sample where the iterator is pointing to.

Sample get_all_related(const Iterator &iter) const#

Get the sample where the iterator is pointing to.

This method is only valid when the iterator is pointing to a valid sample, and will return a sample contains all properties related to runtime in the graph, which may cause more memory usage and performance loss as the adapter will read all properties of the sample from the database required by runtime. If you only care about the input properties of the runtime, please use get() instead.

See also

get()

Parameters:

iter – The iterator to get the sample from.

Throws:

excepts::InvalidIterator – throws if the iterator is point to an empty sample or the sample does not meet the runtime’s requirements.

Returns:

Sample The sample where the iterator is pointing to.

void update(uint32_t id, const Sample &sample)#

Update the sample set’s output properties with the sample.

Note

This function will only save the runtime’s output properties into the sample set, and runtime’s input properties and other un-related properties will not be saved. If you want to save all properties, please use update_all_related() instead.

Parameters:
  • id – The ID of the sample in the sample set.

  • sample – The sample to update the sample set’s properties.

Throws:
void update_all_related(uint32_t id, const Sample &sample)#

Update the all sample properties in sample set with the sample.

This function will update all sample properties related to the runtime in sample set, which may cause efficiency issues due to reading and writing more data then update. If you can ensure that properties not output by the runtime is not changed, you can use update() instead.

Parameters:
  • id – The ID of the sample in the sample set.

  • sample – The sample to update the sample set’s properties.

Throws:
class SampleSetRuntimeAdapterIterator#

Iterator to iterate all samples meeting the runtime’s requirements in the runtime sample set adapter.

Public Functions

bool is_valid() const#

Check if the iterator is pointing to a valid sample.

Returns:

true If the iterator is pointing to a valid sample.

Returns:

false If the iterator is not pointing to a valid sample.

bool operator==(const SampleSetRuntimeAdapterIterator &other) const#

Check if two iterators point to the same sample.

Parameters:

other – The other iterator.

Returns:

true if two iterators point to the same sample.

Returns:

false if two iterators point to different samples.

SampleSetRuntimeAdapterIterator &operator++() noexcept#

Move to next sample meeting the runtime’s requirements.

Returns:

SampleSetRuntimeAdapterIterator& The iterator after moving.

SampleSetRuntimeAdapterIterator operator++(int) noexcept#

Move to next sample meeting the runtime’s requirements.

Returns:

SampleSetRuntimeAdapterIterator The iterator before moving.

SampleSetRuntimeAdapterIterator &operator--() noexcept#

Move to previous sample meeting the runtime’s requirements.

Returns:

SampleSetRuntimeAdapterIterator& The iterator after moving.

SampleSetRuntimeAdapterIterator operator--(int) noexcept#

Move to previous sample meeting the runtime’s requirements.

Returns:

SampleSetRuntimeAdapterIterator The iterator before moving.

uint32_t id() const#

Get Sample ID.

Throws:

excepts::InvalidIterator – throws if the iterator is point to an empty sample or the sample not meet the runtime’s requirements.

Returns:

uint32_t The ID of the sample.

std::pair<uint32_t, Sample> operator*() const#

Read Sample from SampleSet database.

Note

This interface will only read properties required by runtime, so the sample returned would not contain all properties data in the database of the sample.

Throws:
Returns:

std::pair<uint32_t, Sample> The ID of the sample and the sample.

class IStrategy#

IStrategy is the information bridge between user and Runtime. The specific sub-class of IStrategy contains two kind of information:

  1. strategy class type (or class name);

  2. the required data to infer the subgraph provided by user;

Subclassed by aidi::strategy::OneTool, aidi::strategy::OneToolAndDepends

Public Functions

virtual bool is_allow_virtual() const = 0#

return whether the strategy allow virtual_oper exist in runtime.

Returns:

bool true if allow, false otherwise.

class OneTool : public aidi::strategy::IStrategy#

Public Functions

virtual bool is_allow_virtual() const override#

return whether the strategy allow virtual_oper exist in runtime.

Returns:

bool true if allow, false otherwise.

class OneToolAndDepends : public aidi::strategy::IStrategy#

Public Functions

virtual bool is_allow_virtual() const override#

return whether the strategy allow virtual_oper exist in runtime.

Returns:

bool true if allow, false otherwise.

using aidi::PropIDTypeMap = std::map<ToolNodeId, std::string>#

property’s tool_node_id - property’s type