55 #include <vici/stringy.h>
80 typedef const std::string &
csr;
89 typedef std::vector< std::string >
ArgList;
142 std::map< Module, FactoryPtr> factories;
155 auto F = factories.find(nm);
156 if ( F == factories.end() )
157 throw VX(
Code) <<
"Could not find factory for " << nm;
158 f = std::dynamic_pointer_cast<T>(F->second);
160 throw VX(
Code) <<
"Module refers to wrong type of factory";
260 virtual void getError(
int & line,
int & column, std::string & text ) = 0;
322 virtual void show(
csr s ) = 0;
446 virtual void show() = 0;
518 virtual void setFile(
int state,
csr filename ) = 0;
548 virtual void done() = 0;
641 virtual void run() = 0;
647 virtual void run(
csr functionName ) = 0;
650 virtual void pause() = 0;
659 virtual void resume() = 0;
662 virtual void kill() = 0;
787 virtual void opened() = 0;
793 virtual void dragged(
double x,
double y ) = 0;
837 virtual void draw(
Scene *scene,
double x,
double y,
double scale ) = 0;
1030 virtual void load(
csr filename ) = 0;
1036 virtual void save(
csr filename ) = 0;
1148 virtual void show() = 0;
1288 virtual void show() = 0;
1348 virtual void show() = 0;
An API for the vici runtime gui.
Definition: vici.h:1444
standard input stream
Definition: vici.h:751
virtual void setAttributes(SymbolAttributes &att)=0
change the attributes of the symbol
A parser for EBNF.
Definition: vici.h:243
virtual ParseTree * parse(csr s)=0
parse the EBNF
Severity
Severity levels for log messages.
Definition: vx.h:48
virtual void setValue(csr varName, csr value)=0
this is called when a variable has its value changed by the user
An abstract factory for making an instance of Command.
Definition: vici.h:1181
virtual int result()=0
get the exit code
signal a semaphore
Definition: vici.h:745
An abstract factory for making an instance of Vici.
Definition: vici.h:1469
virtual void addSignature(csr filename)=0
sign this file with the user's key
standard error stream
Definition: vici.h:753
virtual ~ViciEditor()
virtual destructor
Definition: vici.h:1400
diamond for a command
Definition: vici.h:730
virtual void dataReady(NodeId node)=0
this gets called when data is available on a display
virtual ~Secure()
virtual destructor
Definition: vici.h:1218
virtual void show(csr s)=0
display the syntax chart for the supplied ebnf
void getFactory(Module nm, std::shared_ptr< T > &f)
Get a factory of the specified type.
Definition: vici.h:153
Install a script into the user's desktop.
Definition: vici.h:1336
An abstract factory for making an instance of Interpreter.
Definition: vici.h:678
std::shared_ptr< ViciFactory > ViciFactoryPtr
Shared pointer for Vici Factory.
Definition: vici.h:1480
SymbolAttributes()
constructor
Definition: vici.h:719
std::string linePattern
the pattern for the lines
Definition: vici.h:724
The interface that must be implemented by clients of the interpreter.
Definition: vici.h:501
virtual void save(csr filename)=0
save the chart
virtual ViciEditor * makeViciEditor()=0
create an instance of the ViciEditor class
virtual ~SecureFactory()
virtual destructor
Definition: vici.h:1247
std::shared_ptr< EBNF_Factory > EBNF_FactoryPtr
Shared pointer for EBNF_Factory.
Definition: vici.h:291
virtual ~Canvas()
virtual destructor
Definition: vici.h:1023
virtual void pause()=0
pause the script
virtual SymbolAttributes getDefaultAttr(Style s)=0
get the attributes for a symbol of the given style
virtual ~Scene()
virtual destructor
Definition: vici.h:208
A wrapper class for windows.
Definition: vici.h:190
virtual Cron * makeCron(Window *w)=0
create an instance of the Cron class
void registerFactory(Module m, FactoryPtr f)
Register a factory.
Definition: factory.cpp:115
void * makeViciFactory()
create a new Vici Factory
TextAttributes()
constructor
Definition: vici.h:768
virtual ~ViciFactory()
virtual destructor
Definition: vici.h:1472
virtual ~InterpreterFactory()
virtual destructor
Definition: vici.h:681
virtual void optionsAndParameters(NodeId nid, const ArgList &args)=0
this gets called when the user presses OK
int NodeId
Type for identifying a node of the flowchart.
Definition: vici.h:83
virtual Installer * makeInstaller(Window *w)=0
create an instance of the Installer class
virtual void openFile(const Path &)=0
Set the file to execute.
float fontSize
the size of the font
Definition: vici.h:771
void * makeAdminFactory()
create a new Admin Factory
std::shared_ptr< CronFactory > CronFactoryPtr
Shared pointer for Cron Factory.
Definition: vici.h:1315
virtual VICI::Window * getMainWindow()=0
Get a pointer to the main window.
virtual ArgList getNames()=0
get a list of names of variables etc for use in command options
virtual void addClient(InterpreterClient *)=0
add a client for notifications
Provide security for the scripts.
Definition: vici.h:1215
virtual ~SymbolFactory()
virtual destructor
Definition: vici.h:956
A programming error has been detected.
Definition: vx.h:53
virtual ~SyntaxFactory()
virtual destructor
Definition: vici.h:339
virtual Interpreter * makeInterpreter(Sec::Secure *sec)=0
create an instance of the Interpreter class
virtual void selected()=0
the object has become selected
static const NodeId OutDisplay
the node id of the default output display
Definition: vici.h:564
virtual void setCurrentFile(csr filename)=0
Set the file to schedule.
constant
Definition: vici.h:734
Represents something that is notified about events occurring on a symbol.
Definition: vici.h:782
virtual void loadSnapshot(csr filename)=0
restore a snapshot file
virtual ~InstallerFactory()
virtual destructor
Definition: vici.h:1364
void * makeSymbolFactory()
create a new Symbol Factory
Allow the user to search for, and organise commands.
Definition: vici.h:441
virtual SymbolMgr * makeSymbolMgr(Window *w)=0
create an instance of the SymbolMgr class
virtual ~EBNF()
virtual destructor
Definition: vici.h:246
An interface that is notified of a command selection.
Definition: vici.h:1115
virtual void setFile(int state, csr filename)=0
this gets called when a monitored file changes state.
static FactoryFactory & instance()
Get a reference to the singleton object.
Definition: factory.cpp:106
virtual void setInterval(double secs)=0
set the time interval between executing commands
virtual ~Symbol()
virtual destructor
Definition: vici.h:807
virtual void step(ThreadId tid)=0
virtual ~CanvasFactory()
virtual destructor
Definition: vici.h:1089
virtual void selection(Symbol::Symbol *sym)=0
notification that a symbol has been selected
virtual void breakReached(ThreadId tid, NodeId node)=0
this gets called when a break point is reached
An abstract factory for making an instance of ViciEditor.
Definition: vici.h:1415
virtual void setCursor(ThreadId tid, NodeId node)=0
this gets called as the shell steps through the script
semaphore variable
Definition: vici.h:736
std::shared_ptr< SyntaxFactory > SyntaxFactoryPtr
Shared pointer for SyntaxFactory.
Definition: vici.h:351
virtual ~ViciAdminFactory()
virtual destructor
Definition: vici.h:389
The interface that must implemented for clients of Search.
Definition: vici.h:417
entry point for a function
Definition: vici.h:732
virtual ~SymbolMgr()
virtual destructor
Definition: vici.h:913
std::shared_ptr< CanvasFactory > CanvasFactoryPtr
Shared pointer for Canvas Factory.
Definition: vici.h:1097
void * makeCanvasFactory()
create a new Canvas Factory
virtual void cmndError(csr msg)=0
this gets called if there is an error
execution flow for a failure result
Definition: vici.h:749
An abstract factory for making an instance of Cron.
Definition: vici.h:1301
std::shared_ptr< SearchFactory > SearchFactoryPtr
Shared pointer for Search Factory.
Definition: vici.h:476
Colour lineColour
the colour for lines
Definition: vici.h:721
Colour fillColour
the colour to fill the symbol
Definition: vici.h:722
virtual void show()=0
Display the window.
virtual ~SearchFactory()
virtual destructor
Definition: vici.h:463
Module
An enum that lists the main modules of VICI.
Definition: vici.h:112
virtual void newSymbol(Symbol::Symbol *sym)=0
called when a symbol is placed on the canvas.
An abstract factory for making an instance of ViciAdmin.
Definition: vici.h:386
virtual EBNF * makeEBNF()=0
the factory for EBNF objects
virtual void changedChart()=0
called when the chart is first changed
virtual ~Cron()
virtual destructor
Definition: vici.h:1279
std::shared_ptr< CommandFactory > CommandFactoryPtr
Shared pointer for Command Factory.
Definition: vici.h:1192
virtual VICI::Window * getMainWindow()=0
Get a pointer to the app main window.
void * makeEditorFactory()
create a new Editor Factory
box for a command
Definition: vici.h:729
virtual TextAttributes getDefaultTextAttr()=0
get the current default text attributes
A type for the parsed form of EBNF.
Definition: vici.h:226
virtual int openDisplay(NodeId node)=0
open a Display object for reading
virtual void show()=0
Display the window.
virtual void getError(int &line, int &column, std::string &text)=0
get location and details of parsing error
variable
Definition: vici.h:733
virtual void setNodeId(NodeId nid)=0
Set the node id for the object.
virtual bool isCommand()=0
check if the symbol represents a command object
virtual void setScript(csr filename)=0
the XML VICI script to execute
virtual void textAttr(TextAttributes &att)=0
notify that the default text attributes have changed
long Colour
Specialisation for holding colour values.
Definition: vici.h:703
virtual void setNode(NodeId)=0
set the identity of the current node
An abstract factory for making an instance of Canvas.
Definition: vici.h:1086
Manipulate path strings.
Definition: stringy.h:74
int ThreadId
type for identifying a thread in the running script
Definition: vici.h:86
virtual void saveSnapshot(csr filename)=0
save a snapshot file
virtual ~SymbolClient()
virtual destructor
Definition: vici.h:880
virtual ~CommandFactory()
virtual destructor
Definition: vici.h:1184
void * makeSyntaxFactory()
create a new Syntax Factory
function call
Definition: vici.h:731
A wrapper for QGraphicsScene class.
Definition: vici.h:205
Allow scripts to be scheduled for later running.
Definition: vici.h:1276
Display a syntax chart of command options.
Definition: vici.h:313
Hold the attributes of a text comment.
Definition: vici.h:764
output display
Definition: vici.h:740
virtual Style getStyle()=0
get the style for the symbol
execution flow for a success result
Definition: vici.h:748
Represents something that is drawn on the canvas.
Definition: vici.h:804
virtual ~CronFactory()
virtual destructor
Definition: vici.h:1304
virtual Vici * makeVici(Window *w=nullptr)=0
create an instance of the Vici class
virtual void openFile(const VICI::Path &)=0
Tell the editor which file to start with.
virtual void run()=0
start running the script
An abstract factory for making an instance of SymbolMgr.
Definition: vici.h:953
virtual ~Vici()
virtual destructor
Definition: vici.h:1447
virtual ~ParseTree()
virtual destructor
Definition: vici.h:229
void * makeInstallerFactory()
create a new Installer Factory
static const NodeId ErrDisplay
the node id of the default error display
Definition: vici.h:565
std::vector< std::string > ArgList
Type for a list of command arguments and options.
Definition: vici.h:89
virtual Search * makeSearch(Window *w, SearchClient *sc)=0
create an instance of the Search class
std::shared_ptr< Factory > FactoryPtr
Shared pointer for factory.
Definition: vici.h:107
virtual void done()=0
this gets called when the script completes
std::shared_ptr< SecureFactory > SecureFactoryPtr
Shared pointer for Secure Factory.
Definition: vici.h:1257
virtual ~Installer()
virtual destructor
Definition: vici.h:1339
An abstract factory for making an instance of Syntax.
Definition: vici.h:336
virtual void symbolAttr(Symbol::SymbolAttributes &)=0
unused by this library
virtual void symbolAttr(SymbolAttributes &att)=0
notify that the default symbol attributes have changed
send a signal
Definition: vici.h:750
virtual void show()=0
make the search window visible
virtual ~Syntax()
virtual destructor
Definition: vici.h:316
virtual ~Search()
virtual destructor
Definition: vici.h:444
An abstract factory for making an instance of Installer.
Definition: vici.h:1361
virtual Command * makeCommand(Window *, CommandClient *, Canvas::Canvas *)=0
create an instance of the Command class
virtual void attachCommand(const ArgList &args)=0
Associate the symbol with a command.
virtual void setExecution(bool active, csr node)=0
display of executing script
An interface that is notified of canvas actions.
Definition: vici.h:985
An interface that is notified of changes to symbol manager.
Definition: vici.h:877
virtual void reportError(Severity sev, csr msg)=0
This gets called if an error is detected.
virtual ~SearchClient()
virtual destructor
Definition: vici.h:420
virtual void textAttr(Symbol::TextAttributes &att)=0
notification of new text attributes
virtual void selectedCommand(NodeId n, csr c)=0
this function is called when the user selects a command.
Holds the attributes of a symbol.
Definition: vici.h:715
virtual bool validate(csr s)=0
confirm that an EBNF is valid
virtual void setArgs(VICI::ArgList args)=0
set the program options
Style
The possible styles for symbols and lines.
Definition: vici.h:728
virtual ~Command()
virtual destructor
Definition: vici.h:1145
virtual void newChart()=0
called when a new diagram has been started
virtual bool verifySignature(csr filename)=0
check to ensure we are allowed to open this file
virtual void autoStart()=0
Start the script as soon as the GUI is ready.
virtual void breakAction(NodeId, bool set)=0
notification that a breakpoint has been set or cleared
virtual void symbolAttr(Symbol::SymbolAttributes &att)=0
notification that the default symbol attributes have changed
virtual void setCommand(NodeId nid, const ArgList &args)=0
assigning a command to the current symbol
An abstract type for factories.
Definition: vici.h:99
Application for preparing commands.
Definition: vici.h:370
std::shared_ptr< InstallerFactory > InstallerFactoryPtr
Shared pointer for Installer Factory.
Definition: vici.h:1375
virtual Syntax * makeSyntax(Window *w, EBNF::EBNF *ebnf)=0
Create an instance of Syntax.
named pipe
Definition: vici.h:739
The facade for the symbol library.
Definition: vici.h:910
virtual void dataAck(NodeId node)=0
call this after responding to InterpreterClient::dataReady() to wait for the next set of data...
virtual void selection(Symbol *sym)=0
notify that a symbol has been selected.
The API for interpreter library.
Definition: vici.h:561
virtual ~CanvasClient()
virtual destructor
Definition: vici.h:988
virtual void debugMode(bool mode)=0
enable debug mode
virtual ~Interpreter()
virtual destructor
Definition: vici.h:567
The facade for the command library.
Definition: vici.h:1142
flow of execution
Definition: vici.h:747
virtual void show()=0
display the command entry window
virtual void setPosn(ThreadId tid, NodeId node)=0
call this to set the point where execution resumes
standard output stream
Definition: vici.h:752
virtual void setCurrentFile(csr filename)=0
Set the script to install.
const std::string & csr
short cut for string constants
Definition: vici.h:80
void * makeCronFactory()
create a new Cron Factory
wait for a semaphore
Definition: vici.h:744
virtual ~ViciAdmin()
virtual destructor
Definition: vici.h:373
mutex variable
Definition: vici.h:735
virtual ~ViciEditorFactory()
virtual destructor
Definition: vici.h:1418
void * makeInterpreterFactory()
create a new Interpreter Factory
virtual Interp::Interpreter * getInterpreter()=0
Get a reference to the interpreter object.
virtual ~EBNF_Factory()
virtual destructor
Definition: vici.h:281
virtual void textAttr(Symbol::TextAttributes &)=0
unused by this library
virtual Canvas * makeCanvas(Window *, Symbol::SymbolMgr *, Interp::Interpreter *, CanvasClient *)=0
create an instance of the Canvas class
file
Definition: vici.h:737
An abstract factory for making an instance of EBNF.
Definition: vici.h:278
virtual void load(csr filename)=0
restore the chart from the specified XML file.
virtual Secure * makeSecure()=0
create an instance of the Secure class
virtual Symbol * clone(SymbolOwner *owner)=0
construct a copy of the symbol
virtual void draw(Scene *scene, double x, double y, double scale)=0
display the object
void * makeEBNFFactory()
create a new EBNF Factory
virtual ~Factory()
Destructor.
Definition: vici.h:103
virtual ~CommandClient()
virtual destructor
Definition: vici.h:1118
An abstract factory for making an instance of Search.
Definition: vici.h:460
An abstract factory for making an instance of Secure.
Definition: vici.h:1244
void * makeCommandFactory()
create a new Command Factory
The flowchart editor.
Definition: vici.h:1396
virtual ViciAdmin * makeViciAdmin()=0
Create an instance of the ViciAdmin class.
virtual ~Window()
virtual destructor
Definition: vici.h:193
void * makeSecureFactory()
create a new Secure Factory
virtual void resume()=0
resume a paused script
virtual void setBreak(NodeId node, bool set)=0
call this to mark a node as a break point
std::string fontName
the name of the font face
Definition: vici.h:770
std::shared_ptr< ViciEditorFactory > ViciEditorFactoryPtr
Shared pointer for Editor Factory.
Definition: vici.h:1426
std::shared_ptr< SymbolFactory > SymbolFactoryPtr
Shared pointer for Symbol Factory.
Definition: vici.h:967
virtual void kill()=0
stop the script
virtual void setCommand(NodeId nid, const ArgList &args)=0
set the initial value of the command
virtual ~SymbolOwner()
virtual destructor
Definition: vici.h:785
virtual void setValue(csr varName, csr value)=0
this gets called when a script variable has a change of value
lock a mutex
Definition: vici.h:742
virtual void selection(Symbol::Symbol *sym)=0
notification of new current symbol
inline file
Definition: vici.h:738
virtual Symbol * getSymbol(Style style, SymbolOwner *owner)=0
get a new symbol of the specified style
#define VX(x)
Macro to include file name and line number in exception messages.
Definition: vx.h:210
virtual ~InterpreterClient()
virtual destructor
Definition: vici.h:504
virtual void addClient(SymbolClient *client)=0
add a client for the symbol manager
virtual void searchAction(NodeId)=0
notification that the user wants the search tab
std::shared_ptr< ViciAdminFactory > ViciAdminFactoryPtr
Shared pointer for Admin Factory.
Definition: vici.h:399
std::shared_ptr< InterpreterFactory > InterpreterFactoryPtr
Shared pointer for Interpreter Factory.
Definition: vici.h:691
The facade for canvas library.
Definition: vici.h:1020
virtual void setHighlight(bool x)=0
show the symbol as selected
Responsible for creating and supplying factories for the main modules.
Definition: vici.h:138
unlock a mutex
Definition: vici.h:743
std::string fillPattern
the pattern to fill the symbol
Definition: vici.h:723
void * makeSearchFactory()
create a new Search Factory
virtual void commandAction(NodeId, const ArgList &)=0
notification that the command tab is to be displayed
virtual void dragged(double x, double y)=0
the object was moved