AuboStudio SDK 0.6.3

Public 成员函数 | Private 成员函数 | Private 属性 | 友元 | 所有成员列表
arcs::aubo_scope::ProgramModel类 参考

`#include <program_model.h>`

## Public 成员函数
| ProgramModel (ProgramModel &f)
| ProgramModel (ProgramModel &&f)
virtual | ~ProgramModel ()
ProgramNodeFactoryPtr | getProgramNodeFactory ()
| This method returns a ProgramNodeFactory to create program nodes. 更多...
TreeNodePtr | getTreeNode (ProgramNodeContribution *root)
| Gets the TreeNode root from ProgramNodeContribution. 更多...

## Private 成员函数
| ProgramModel ()

## Private 属性
void * | d_ { nullptr }

## 友元
class | DataSwitch

## 详细描述

# Summary

This interface makes it possible to modify sub-trees of aubo_studio plugins. The structure of trees is separated from the contents of the nodes. The TreeNode interface is concerned with the structure of trees whereas the ProgramNode interface deals with the concrete content of the nodes of the tree.

# Getting started with program modification

A ProgramModel contains a:

- getProgramNodeFactory() - that makes it possible to create new program nodes (both built-in AuboScope nodes and AuboCap program nodes).
- getRootTreeNode(ProgramNodeContribution root)} - returns the sub-tree of a given AuboCap ProgramNodeContribution

The TreeNode interface supports insertion and removal of nodes. With it you can retrieve the list of children of particular nodes. Calling lockChildSequence on a tree node, locks the immediate children under the node. I.e. children can not be rearranged, deleted or have other nodes inserted into the child sequence by the end user.

# Example code

    public class UpdateProgramExampleContribution implements
    ProgramNodeContribution { ProgramModel programModel;

         public UpdateProgramExampleContribution(API api) {
             this.programModel = api.getProgramModel();
         }

         private void insertIntoProgramTree() {
             TreeNode treeNode = programModel.createRootTreeNode(this);
             try {
                 treeNode.addChild(programModel.getProgramNodeFactory().createCommentNode());
             } catch (TreeStructureException e) {
                 // Your handler code
             }
         }

         //...
         //... rest of the implementation and a call to insertIntoProgramTree()
         //...
    }

在文件 program_model.h 第 62 行定义.

## 构造及析构函数说明

## ◆ ProgramModel() [1/3]

arcs::aubo_scope::ProgramModel::ProgramModel | ( | ProgramModel & | f | ) |

## ◆ ProgramModel() [2/3]

arcs::aubo_scope::ProgramModel::ProgramModel | ( | ProgramModel && | f | ) |

## ◆ ~ProgramModel()

virtual arcs::aubo_scope::ProgramModel::~ProgramModel | ( |  | ) |
| virtual

## ◆ ProgramModel() [3/3]

arcs::aubo_scope::ProgramModel::ProgramModel | ( |  | ) |
| private

## 成员函数说明

## ◆ getProgramNodeFactory()

ProgramNodeFactoryPtr arcs::aubo_scope::ProgramModel::getProgramNodeFactory | ( |  | ) |

This method returns a ProgramNodeFactory to create program nodes.

返回
  the factory to create program nodes.

## ◆ getTreeNode()

TreeNodePtr arcs::aubo_scope::ProgramModel::getTreeNode | ( | ProgramNodeContribution * | root | ) |

Gets the TreeNode root from ProgramNodeContribution.

From here, children can be added to form a sub-tree.

参数

  root | The AuboCap program node where a sub-tree is to be rooted.

返回
  Returns a TreeNode root.

## 友元及相关函数文档

## ◆ DataSwitch

friend class DataSwitch
| friend

在文件 program_model.h 第 86 行定义.

## 类成员变量说明

## ◆ d_

void* arcs::aubo_scope::ProgramModel::d_ { nullptr }
| private

在文件 program_model.h 第 88 行定义.

该类的文档由以下文件生成:

- include/aubo_caps/domain/program/program_model.h