jplus Class Reference

A J+ script. More...

#include <jplus.h>

Inheritance diagram for jplus:
Inheritance graph
[legend]
Collaboration diagram for jplus:
Collaboration graph
[legend]

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

jplus::jplus (  ) 

initialize J+ engine with no script

jplus::~jplus (  ) 

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:
name name of variable to compute.
Returns:
the computed variable value.

Reimplemented from jengine.

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.
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:
vars set of variable names to pull.
Returns:
vector of J sentences for computing said variables.
bool jplus::init ( std::istream &  script  ) 

Load and pre-parse J+ script.

Parameters:
script stream, 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:
name name of the variable.
data array for the variable to refer to.
Returns:
"true" upon success.

The documentation for this class was generated from the following file:
Generated on Mon Jun 25 21:17:57 2012 for jplus-0.4.1 by  doxygen 1.6.3