jplus-0.4.6
jplus Class Reference

A J+ script. More...

#include <src/jplus.h>

Inheritance diagram for jplus:
Collaboration diagram for jplus:

Public Member Functions

 jplus ()
 initialize J+ engine with no script
bool init (std::istream &script)
 Load and pre-parse J+ script.
 ~jplus ()
 Free allocated memory.
bool set (std::string name, jarray data)
 Set value of the specified variable inside J+ environment, mark all dependent variables "dirty".
jarray get (std::string name)
 Perform all the necessary calculations to computate the specified variable, return its value in an array.
std::vector< std::string > getProgram (std::set< std::string > vars)
 Pull minimal set of J sentences for computing a given set of variables, assuming everything is "dirty".
std::vector< std::string > getProgram ()
 Pull all the sentences in J+ script.

Protected Member Functions

virtual void libInit ()
 Called by the constructor before parsing the J+ script.

Detailed Description

A J+ script.


Constructor & Destructor Documentation

initialize J+ engine with no script

Free allocated memory.


Member Function Documentation

jarray jplus::get ( std::string  name)

Perform all the necessary calculations to computate the specified variable, return its value in an array.

Parameters:
namename of variable to compute.
Returns:
the computed variable value.

Reimplemented from jengine.

std::vector<std::string> jplus::getProgram ( std::set< std::string >  vars)

Pull minimal set of J sentences for computing a given set of variables, assuming everything is "dirty".

Parameters:
varsset of variable names to pull.
Returns:
vector of J sentences for computing said variables.
std::vector<std::string> jplus::getProgram ( )

Pull all the sentences in J+ script.

This pulls all the sentences, assigning value of some variable.

Returns:
vector of J sentences in J script.
bool jplus::init ( std::istream &  script)

Load and pre-parse J+ script.

Parameters:
scriptstream, containing the script to load.
Returns:
"true" upon success.

Reimplemented in yacts.

virtual void jplus::libInit ( ) [protected, virtual]

Called by the constructor before parsing the J+ script.

Does nothing by default, but can be overridden to prepend an additional J+ stream with some definitions and/or define a few verbs and adverbs to be used in J+ program.

Reimplemented in yacts.

bool jplus::set ( std::string  name,
jarray  data 
)

Set value of the specified variable inside J+ environment, mark all dependent variables "dirty".

Parameters:
namename of the variable.
dataarray for the variable to refer to.
Returns:
"true" upon success.

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