HPS::HCA::Model Class Reference

#include <sprk_hca.h>

Public Member Functions

bool Empty ()
 
bool Equals (Model const &other) const
 
void Hide (HPS::Canvas const &in_canvas, int64_t in_node_id)
 
void Highlight (HPS::Canvas const &in_canvas, HighlightOptionsKit const &in_highlight_options, int64_t in_node_id)
 
void Highlight (HPS::Canvas const &in_canvas, HighlightOptionsKit const &in_highlight_options, HPS::Int64Array const &in_node_ids)
 
bool IsHidden (int64_t in_node_id)
 
bool IsHighlighted (int64_t in_node_id)
 
void Isolate (HPS::Canvas const &in_canvas, int64_t in_node_id)
 
 Model ()
 
 Model (HPS::Model const &in_model)
 
 Model (Model const &that)
 
 Model (Model &&that)
 
void OnHighlightUnhighlight ()
 
bool operator!= (Model const &other) const
 
Modeloperator= (Model &&other)
 
bool operator== (Model const &other) const
 
bool RequestNodeProperties (int64_t in_node_id, uint32_t &out_request_id)
 
bool RetrieveNodeProperties (uint32_t in_request_id, uint32_t in_timeout_ms, int64_t &out_node_id, bool &out_valid, HPS::UTF8Array &out_keys, HPS::UTF8Array &out_values)
 
void Show (HPS::Canvas const &in_canvas, int64_t in_node_id)
 
void ShowAll (HPS::Canvas const &in_canvas)
 
bool ShowNodeChildren (int64_t in_node_id, HPS::Int64Array &out_ids)
 
bool ShowNodeFromKeyPath (HPS::KeyPath const &in_key_path, int64_t &out_node_id)
 
bool ShowNodeName (int64_t in_node_id, HPS::UTF8 &out_name)
 
bool ShowNodeParent (int64_t in_node_id, int64_t &out_parent_id)
 
bool ShowRootNode (int64_t &out_node_id)
 
void Unhighlight (HPS::Canvas const &in_canvas, int64_t in_node_id)
 
void UnhighlightAll (HPS::Canvas const &in_canvas)
 
void Zoom (HPS::Canvas const &in_canvas, int64_t in_node_id)
 

Friends

class ModelTreeItem
 

Detailed Description

The Model class provides interactions with a HCA Model

Constructor & Destructor Documentation

◆ Model() [1/4]

HPS::HCA::Model::Model ( )

Constructs an uninitialized HCA::Model.

◆ Model() [2/4]

HPS::HCA::Model::Model ( HPS::Model const &  in_model)

Constructs a HCA::Model under an existing HPS::Model.

Parameters
in_modelthe HPS::Model under which to create an HCA::Model.

◆ Model() [3/4]

HPS::HCA::Model::Model ( Model const &  that)

Copy constructor. This constructor creates an HCA::Model which shares the same resources of the source HCA::Model.

Parameters
in_thatThe source HCA::Model to copy.

◆ Model() [4/4]

HPS::HCA::Model::Model ( Model &&  that)

The move constructor creates an HCA::Model by transferring the underlying object of the rvalue reference to this HCA::Model.

Parameters
in_thatAn rvalue reference to an HCA::Model to take the underlying object from.

Member Function Documentation

◆ Empty()

bool HPS::HCA::Model::Empty ( )

Checks the state of the Model.

Returns
true if this Model is uninitialized, false otherwise.

◆ Equals()

bool HPS::HCA::Model::Equals ( Model const &  other) const

Check if the source Model is equivalent to this Model.

Parameters
otherThe source Model to compare to this Model.
Returns
true if the objects are equivalent, false otherwise.

◆ Hide()

void HPS::HCA::Model::Hide ( HPS::Canvas const &  in_canvas,
int64_t  in_node_id 
)

Hides the specified node under the given Canvas. This makes the selected node invisible. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_canvasThe Canvas in which to hide the node.
in_node_idThe ID of the node to be hidden

◆ Highlight() [1/2]

void HPS::HCA::Model::Highlight ( HPS::Canvas const &  in_canvas,
HighlightOptionsKit const &  in_highlight_options,
int64_t  in_node_id 
)

Highlights the specified node under the given Canvas, using the options provided. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_canvasThe Canvas in which to highlight the node.
in_highlight_optionsThe options to be used when highlighting in_node_id.
in_node_idThe ID of the node to be highlighted

◆ Highlight() [2/2]

void HPS::HCA::Model::Highlight ( HPS::Canvas const &  in_canvas,
HighlightOptionsKit const &  in_highlight_options,
HPS::Int64Array const &  in_node_ids 
)

Highlights the specified nodes under the given Canvas, using the options provided. All specified nodes will be highlighted using the same options. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_canvasThe Canvas in which to highlight the nodes.
in_highlight_optionsThe options to be used when highlighting in_node_ids.
in_node_idsan array of node IDs to be highlighted

◆ IsHidden()

bool HPS::HCA::Model::IsHidden ( int64_t  in_node_id)

Checks whether the given node is currently Hidden as a result of a Hide or Isolate operation. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_node_idThe ID of the node to examine.
Returns
true if the node is hidden, false otherwise.

◆ IsHighlighted()

bool HPS::HCA::Model::IsHighlighted ( int64_t  in_node_id)

Checks whether the given node is currently highlighted. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_node_idThe ID of the node to examine.
Returns
true if the node is highlighted, false otherwise.

◆ Isolate()

void HPS::HCA::Model::Isolate ( HPS::Canvas const &  in_canvas,
int64_t  in_node_id 
)

Shows only the specified node and hides the rest. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_canvasThe Canvas in which to isolate the node.
in_node_idThe ID of the node to isolate.

◆ OnHighlightUnhighlight()

void HPS::HCA::Model::OnHighlightUnhighlight ( )

This convenience function performs the HCA::ModelTreeItem::OnHighlightUnhighlight function on the root item of the Model Tree See the description of HCA::ModelTreeItem::OnHighlightUnhighlight for more information.

◆ operator!=()

bool HPS::HCA::Model::operator!= ( Model const &  other) const

Check if the source Model is not equivalent to this Model.

Parameters
otherThe source Model to compare to this Model.
Returns
true if the objects are not equivalent, false otherwise.

◆ operator=()

Model& HPS::HCA::Model::operator= ( Model &&  other)

Copies the source Model into this Model.

Parameters
otherThe source Model to copy.
Returns
A reference to this Model.

◆ operator==()

bool HPS::HCA::Model::operator== ( Model const &  other) const

Check if the source Model is equivalent to this Model.

Parameters
otherThe source Model to compare to this Model.
Returns
true if the objects are equivalent, false otherwise.

◆ RequestNodeProperties()

bool HPS::HCA::Model::RequestNodeProperties ( int64_t  in_node_id,
uint32_t &  out_request_id 
)

Requests properties for the specified node. throws HPS::InvalidObjectException is the Model is uninitialized. When the request has been fulfilled, an event of type HCA::RequestIdEvent will be injected to the Database's Event Dispatcher. Registering a handler to HCA::RequestIdEvent will allow the user to know when this request has completed. The value of HCA::RequestIdEvent::request_id object will match out_requested_id, returned by this function.

Parameters
in_node_idthe ID for the node whose properties should be collected.
out_request_idan ID which uniquely identifies this request
Returns
true if the node's properties were gathered successfully, false otherwise.

◆ RetrieveNodeProperties()

bool HPS::HCA::Model::RetrieveNodeProperties ( uint32_t  in_request_id,
uint32_t  in_timeout_ms,
int64_t &  out_node_id,
bool &  out_valid,
HPS::UTF8Array out_keys,
HPS::UTF8Array out_values 
)

Retrieves previously requested properties throws HPS::InvalidObjectException is the Model is uninitialized. Before retrieving properties, you should request them, using RequestNodeProperties. This function waits for the requested property to become available If your model's properties are not changing, it is sufficient to call RequestNodeProperties just once for each node ID of interest. Each property is returned as a pair or key and value. The out_keys and out_values parameters are two parallel arrays containing respectively the key and value of each property.

Parameters
in_request_ida unique ID representing a request for properties. This value is obtained through a call to RequestNodeProperties.
in_timeout_msthe maximum amount of time to wait while trying to retrieve the node properties, specified in milliseconds. Passing 0 means that the function will wait indefinitely until it can retrieve the properties.
out_node_idthe ID of the node for which properties are being returned.
out_validwhether the returned properties are valid.
out_keysthe property keys. Each entry in this array corresponds to the entry at the same index in the out_values array.
out_valuesthe property values. Each entry in this array corresponds to the entry at the same index in the out_keys array.
Returns
true if the node's properties were retrieved successfully, false otherwise.

◆ Show()

void HPS::HCA::Model::Show ( HPS::Canvas const &  in_canvas,
int64_t  in_node_id 
)

Shows the specified node under the given Canvas. This makes the selected node visible. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_canvasThe Canvas in which to show the node.
in_node_idThe ID of the node to be shown

◆ ShowAll()

void HPS::HCA::Model::ShowAll ( HPS::Canvas const &  in_canvas)

Shows all nodes in the model, under the specified Canvas. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_canvasThe Canvas in which to show the nodes.

◆ ShowNodeChildren()

bool HPS::HCA::Model::ShowNodeChildren ( int64_t  in_node_id,
HPS::Int64Array out_ids 
)

Shows the IDs of the children of the requested node. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_node_idthe ID for the node whose children should be shown
out_idsan array of IDs representing the children of in_node_id.
Returns
true if the node's children were found successfully, false otherwise.

◆ ShowNodeFromKeyPath()

bool HPS::HCA::Model::ShowNodeFromKeyPath ( HPS::KeyPath const &  in_key_path,
int64_t &  out_node_id 
)

Given a KeyPath, the associated node ID is returned.

Parameters
in_key_paththe key path for which a node ID is being requested
out_node_idthe node ID that corresponds to in_key_path
Returns
true if the node ID is associated to in_key_path, false otherwise.

◆ ShowNodeName()

bool HPS::HCA::Model::ShowNodeName ( int64_t  in_node_id,
HPS::UTF8 out_name 
)

Shows the name for the requested node. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_node_idthe ID for the node whose name should be shown
out_namethe name of in_node_id, in the UTF8 locale. Might be an empty UTF8 object.
Returns
true if the node name was found successfully, false otherwise.

◆ ShowNodeParent()

bool HPS::HCA::Model::ShowNodeParent ( int64_t  in_node_id,
int64_t &  out_parent_id 
)

Shows the ID of the parent of the requested node. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_node_idthe ID for the node whose parent should be shown
out_parent_idthe ID representing the parent of in_node_id. Might be an empty array
Returns
true if the node's parent was found successfully, false otherwise.

◆ ShowRootNode()

bool HPS::HCA::Model::ShowRootNode ( int64_t &  out_node_id)

Shows the node ID for the root node of the Model. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
out_node_idthe node ID for the root node of the Model.
Returns
true if the root node ID was found, false otherwise.

◆ Unhighlight()

void HPS::HCA::Model::Unhighlight ( HPS::Canvas const &  in_canvas,
int64_t  in_node_id 
)

Unhighlights the specified node under the given Canvas. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_canvasThe Canvas in which to unhighlight the node.
in_node_idThe ID of the node to be unhighlighted

◆ UnhighlightAll()

void HPS::HCA::Model::UnhighlightAll ( HPS::Canvas const &  in_canvas)

Unhighlights all nodes in the model, under the specified Canvas. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_canvasThe Canvas in which to unhighlight the nodes.

◆ Zoom()

void HPS::HCA::Model::Zoom ( HPS::Canvas const &  in_canvas,
int64_t  in_node_id 
)

Smoothly zooms the camera to focus on the specified node. The transition lasts half a second. throws HPS::InvalidObjectException is the Model is uninitialized.

Parameters
in_canvasThe Canvas in which to zoom to the node.
in_node_idThe ID of the node to zoom to.

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