From OpenSCADAWiki
Jump to: navigation, search

Public methods:

  • TCntrNode( TCntrNode *prev = NULL ); — Initialization with an indication of the parent node prev.
  • virtual string objName( ); — Object name. Object-heir should extend the definition of aggregate object name.
  • virtual TCntrNode &operator=( const TCntrNode &node ); — Virtual copy function of the dynamic tree nodes.
  • void cntrCmd( XMLNode *opt, int lev = 0, const string &path = "", int off = 0 ); — Command of work with the control interface of the system. The transport transitions to the full path of the following form are supported: "**/sub_Security/usr_root/%2fgen**" где %2fgen — encoded sub-path to a particular field of the page (/gen).
  • static XMLNode *ctrId( XMLNode *inf, const string &n_id, bool noex = false ); — Getting the XML node by the attribute's value "id" n_id. XML requests of the node by the full path to it are supported (node1/node2/node3).
  • XMLNode *ctrMkNode( const char *n_nd, XMLNode *nd, int pos, const char *path, const string &dscr, int perm = RWRWRW, const char *owner = "root", const char *group = "root", int n_attr = 0, ... ); — Adding the control element to the page. It is possible to specify the set of additional attributes in the number of n_attr as follows: "{attribute1},{values1}, {attribute2},{values2},..." or by zero pointer at the end of the pair sequence (automatically for the definitions ctrMkNode2() and ctrMkNode3()). The attributes owner and group can be in empty string (as in the definition ctrMkNode3()) and perm in -1 for their taking from the nodeAccess() function. The perm attribute also can be both in whole permition form like to RWRWRW or in access bits SEC_RD|SEC_WR for specifying the access mask of the field to the generic node permition.
  • bool ctrRemoveNode( XMLNode *nd, const char *path ); — Removing the control element path from the page nd.
  • bool ctrChkNode( XMLNode *nd, const char *cmd = "get", int perm = R_R_R_, const char *owner = "root", const char *group = "root", char mode = SEC_RD ); — Checking for getting the dynamic command cmd and for the existence of rights to its execution. The attributes owner and group can be in empty string and perm in -1 (as in the definition ctrChkNode2()) for their taking from the nodeAccess() function.
  • ResMtx &dataRes( ); — Mutex for using resources of the node in common purpose.
  • virtual const char *nodeName( ) const; — Node's name.
  • virtual const char *nodeNameSYSM( ) const; — System message's location entry name, to place it to the system's message text by function "mess_sys" and "err_sys". Empty value, by default, to pass the node.
  • string nodePath( char sep = 0, bool from_root = true ) const; — Getting the full path to the node, beginning from the root from_root, and using the separator sep or standard path recording.
  • void nodeList( vector<string> &list, const string& gid = "" ); — Child nodes list list in the specified group gid.
  • AutoHD<TCntrNode> nodeAt( const string &path, int lev = 0, char sep = 0, int off = 0, bool noex = false ); — Attachment to the child node.
  • void nodeDel( const string &path, char sep = 0, int flag = NodeNoFlg ); — Deleting the node using its path.
  • static void nodeCopy( const string &src, const string &dst, const string &user = "root" ); — Copying the nodes of the dynamic tree.
  • TCntrNode *nodePrev( bool noex = false ) const; — Address of the parent node.
  • char nodeFlg( ); — Node's flag.
  • void setNodeFlg( char flg ); — Set flags TCntrNode::SelfModify, TCntrNode::SelfModifyS and TCntrNode::SelfSaveForceOnChild.
  • char nodeMode( ) const; — Node's status.
  • unsigned nodeUse( bool selfOnly ); — Number of the connections to the node. selfOnly — only self connections, without childs.
  • unsigned nodePos( ); — The position of the node in the parent-node's container. It is valid only for ordered containers.
  • virtual char nodeAccess( const string &user, const string &owner = "", const string &group = "", int perm = -1 ); — Getting access to the node through hierarchically checking owner, group and perm, which are resolved whether through the node corresponding properties or redefinition on the first top node or set in "root:root"-RWXRWX___ on the root.
  • bool nodeLoadACL( const string &text ); — Loading the ACL rule from text in line of the form "ACL: {owner}[:{group}[:{perm}]]", where text often is the configuration field of the node description. At successfully loading for the node are set corresponding properties for using by nodeAccess().
  • void nodeLoadACLSnthHgl( XMLNode &shgl ); — Rules of the syntax highlighting for ACL line in text fields.
  • int isModify( int mflg = TCntrNode::All ) const; — Checking for the modification of the node or nodes' branch.
  • void modif( bool save = false, bool forceLoad = false ); — Setting the modification sign of the node, with saving save the sign at the loading and marking for the force loading forceLoad.
  • void modifG( bool forceLoad = false ); — Setting the modification sign of the node branch, with marking for the force loading forceLoad.
  • void modifClr( bool save = false ); — Clearing the modification sign or the saving sign save of the node.
  • void modifGClr( ); — Clearing the modification sign of the node branch.
  • void load( TConfig *cfg = NULL, string *errs = NULL ); — Load the dynamic tree node for ready configuration cfg. The loading errors place to errs by lines.
  • void save( unsigned lev = 0, string *errs = NULL, int *errL = NULL ); — Saving the dynamic tree node, on nesting level lev (service). The saving errors place to errs by lines and maximum level errL.
  • virtual void AHDConnect( ); — Connection to the node (capture of the resource).
  • virtual bool AHDDisConnect( ); — Disсonnection from the node (release of the resource). Resource will remove on zero result.
  • void mess_sys( int8_t level, const char *fmt, ... ); — The system message forms for the node path as the category, the level, the formatted message fmt appended by the node location and followed arguments.
  • TError err_sys( const char *fmt, ... ) const; TError err_sys( int cod, const char *fmt, ... ) const; — The error object forms for the node path as the category, the code cod, the formatted message fmt appended by the node location and followed arguments.
  • TVariant property( const string &id, const TVariant &val, const string &grp = "sys" ); — returns of the object's property id of the Control Interface for the group grp with setting its at val non NULL and EVAL. Where val in EVAL is clearing the property and NULL (TVariant without arguments) just doesn't set nothing.
  • void propertyClrGrp( const string &idPref = "", const string &grp = "sys" ); — clearing the group grp properties at the prefix idPref, that is at empty idPref there are cleared all properties in the grp group. The property container is deleting also with clearing all properties.
  • virtual TVariant objPropGet( const string &id ); — Request of the node's property id as the user's object. It uses now TCntrNode::property() as the objects container in the "usr" group.
  • virtual void objPropSet( const string &id, const TVariant &val ); — Setting the node's property id as the user's object. It uses now TCntrNode::property() as the objects container in the "usr" group.
  • virtual TVariant objFuncCall( const string &id, vector<TVariant> &prms, const string &user_lang ); — Node function id call with the parameters prms and for user/language user_lang ("{user}\n{lang}").
  • int8_t grpSize( ); — Number of the containers with the child nodes.
  • int8_t grpId( const string &sid ); — Getting the index of the group by its ID.
  • virtual AutoHD<TCntrNode> chldAt( int8_t igr, const string &name, const string &user = "" ) const; — Attachment to the child node name of the container gr of the user user.
  • virtual void chldList( int8_t igr, vector<string> &list, bool noex = false ) const; — The list of the child nodes list in the specified container gr.
  • virtual bool chldPresent( int8_t igr, const string &name ) const; — Check for the presence of the specified child node name in the container gr.