- Home
- Installation
- Using Livekeys
- Plugins
- Developer
group lvbase
Contains the core components for Livekeys.
Summary
Members | Descriptions |
---|---|
class lv::ApplicationContext |
Contains the application running context data. |
class lv::CommandLineParser |
Command line parser class. |
class lv::CommandLineParserException |
A simple exception class for the command line parser, with message and code params. |
class lv::Exception |
Standard Exception used throughout Livekeys. |
class lv::LibraryLoadPath |
Class that provides an ability to load libraries given a path (both recursively and non-recursively) |
class lv::LockedFileIOSession |
Handles IO from files in a thread-safe manner. |
class lv::MLNode::BytesType |
Internal type strongly related to MLNode, as one of the types. |
class lv::MLNode::Iterator |
Iterator to be used when the structure of MLNode supports iteration (i.e. arrays or objects) |
class lv::MLNode::ConstIterator |
Constant version of the regular MLNode iterator. |
class lv::MLNode::IteratorValue |
Structure of the result returned by the iterator. |
class lv::MLNode::ConstIteratorValue |
Structure of the result returned by the const iterator. |
class lv::MLNode |
Provides an intermediate representation of objects that can later be converted to a markup language. |
class lv::MLOutOfRanceException |
Out-of-range exception. |
class lv::InvalidMLTypeException |
Invalid ML type exception. |
class lv::TypeNotSerializableException |
Type not serializible exception. |
class lv::Package::Reference |
Stores a reference to another package. |
class lv::Package::Library |
A structure representing a package library. |
class lv::Package::Context |
Presents a context for the given package in relation to the package graph. |
class lv::Package |
Manages a Livekeys package. |
class lv::PackageGraph::LibraryNode |
Struct to represent a library node. |
class lv::PackageGraph |
Structure to represent packages and their dependencies. |
class lv::Plugin::Context |
Presents a context for the given plugin in relation to the package graph. |
class lv::Plugin |
Manages a Livekeys plugin. |
class lv::StackTrace |
Captures and holds a stacktrace. |
class lv::StackFrame |
A frame of debug-related data that gets pushed to the stack trace. |
class lv::Version |
Semantic version container. |
class lv::VisualLog::MessageInfo |
Simple wrapper class for log messages, including the level, timestamp and location info. |
class lv::VisualLog::SourceLocation |
Simple structure containing relevant data about a location of the source. |
class lv::VisualLog::Transport |
Abstraction of the transport used to pass non-visual/object messages. |
class lv::VisualLog::ViewTransport |
Abstraction of the transport used to pass visual (view) messages. |
class lv::VisualLog |
Main logging class. |
class lv::ApplicationContext
Contains the application running context data.
Summary
Members | Descriptions |
---|---|
public ~ApplicationContext () |
Default destructor |
public const std::string & applicationPath () |
Application path getter |
public const std::string & executablePath () |
Executable path getter |
public const std::string & releasePath () |
Release path getter |
public const std::string & applicationFilePath () |
Application file path getter |
public const std::string & linkPath () |
Link path getter |
public const std::string & docsPath () |
Docs path |
public const std::string & pluginPath () |
Plugin path getter |
public const std::string & externalPath () |
External path getter |
public const std::string & librariesPath () |
Libraries path getter |
public const std::string & developmentPath () |
Development path getter |
public const std::string & configPath () |
Config path getter |
public const std::string & appDataPath () |
Returns the AppData path |
public const MLNode & startupConfiguration () |
Returns the startup configuration for Livekeys. |
public void setScriptArguments (const std::vector< std::string > & args) |
|
public const std::vector< std::string > scriptArguments () const |
|
public LibraryTable * libraries () |
Members
public
~ApplicationContext
()
Default destructor
public const std::string &
applicationPath
()
Application path getter
public const std::string &
executablePath
()
Executable path getter
public const std::string &
releasePath
()
Release path getter
public const std::string &
applicationFilePath
()
Application file path getter
public const std::string &
linkPath
()
Link path getter
public const std::string &
docsPath
()
Docs path
public const std::string &
pluginPath
()
Plugin path getter
public const std::string &
externalPath
()
External path getter
public const std::string &
librariesPath
()
Libraries path getter
public const std::string &
developmentPath
()
Development path getter
public const std::string &
configPath
()
Config path getter
public const std::string &
appDataPath
()
Returns the AppData path
Depending on the platform, this can be:
Windows APPDATA%/LiveKeys
macOS $HOME/Library/Application Support/LiveKeys
Linux $HOME/.config/LiveKeys
public const
MLNode
&
startupConfiguration
()
Returns the startup configuration for Livekeys.
public void
setScriptArguments
(const std::vector< std::string > & args)
public const std::vector< std::string >
scriptArguments
() const
public
LibraryTable
*
libraries
()
class lv::CommandLineParser
Command line parser class.
Summary
Members | Descriptions |
---|---|
public CommandLineParser (const std::string & header) |
Simple constructor with a single header parameter. |
public ~CommandLineParser () |
Destructor of CommandLineParser. |
public void parse (int argc,const char *const argv) |
Main function of this class, parses the given number of strings. |
public inline Option * helpOption () |
Returns the help option object containing flag names and description. |
public inline Option * versionOption () |
Returns the version option object, containing flag names and description. |
public Option * addFlag (const std::vector< std::string > & names,const std::string & description) |
Adds a flag with given name(s) and description. |
public Option * addOption (const std::vector< std::string > & names,const std::string & description,const std::string & type) |
Adds an option with given name(s), description and type. |
public const std::string & script () const |
Returns a script argument, if it exists. |
public const std::vector< std::string > & scriptArguments () const |
Returns the arguments listed after a script name. |
public const std::vector< std::string > & arguments () const |
Returns the arguments listed before the script. |
public std::string helpString () const |
Represents a string containing all of the pre-set options, their names, descriptions, types etc. |
public std::vector< std::string > optionNames (Option * option) const |
Returns the name(s) of a given option. |
public bool isSet (Option * option) const |
Returns an indicator that the option is set in the parsed batch of arguments. |
public const std::string & value (Option * option) const |
Returns the parsed value for the given option. |
public void assertIsSet (Option * option) const |
Asserts that the provided option is set in the parsed arguments. |
Members
public
CommandLineParser
(const std::string & header)
Simple constructor with a single header parameter.
Header serves as a sort of title when displaying usage instructions. This constructor also adds the two most common command line flags, "help" and "version".
public
~CommandLineParser
()
Destructor of CommandLineParser.
Erases all the pre-set options.
public void
parse
(int argc,const char *const argv)
Main function of this class, parses the given number of strings.
The arguments are identical to the standard C++ main(argc, argv) params. Each option is given by either its short or long name, preceeded by one or two dashes respectively. If it's a flag, we simply set it to true. If not, we expect another string to follow as a parameter. The first argument is, expectedly, the main program name.
public inline Option *
helpOption
()
Returns the help option object containing flag names and description.
public inline Option *
versionOption
()
Returns the version option object, containing flag names and description.
public Option *
addFlag
(const std::vector< std::string > & names,const std::string & description)
Adds a flag with given name(s) and description.
A flag is a special, bool-like kind of option where just stating it sets it to true. A flag can have a short and/or long name(s), which has to be unique. If not, an exception is thrown.
public Option *
addOption
(const std::vector< std::string > & names,const std::string & description,const std::string & type)
Adds an option with given name(s), description and type.
An option can have a short and/or long name(s), indicated by one or two dashes respectively. The name(s) must be unique - if not, an exception is thrown. The third parameter serves as a type descriptor. Flags are inherently bools, while options in general can be anything like strings, paths, lists...
public const std::string &
script
() const
Returns a script argument, if it exists.
This field is set only in case if there's a script to run in the arguments. Every argument after it relates directly to the script itself.
public const std::vector< std::string > &
scriptArguments
() const
Returns the arguments listed after a script name.
If there's a script name among the command line args, all the following arguments are treated as script arguments and stored in this vector.
public const std::vector< std::string > &
arguments
() const
Returns the arguments listed before the script.
public std::string
helpString
() const
Represents a string containing all of the pre-set options, their names, descriptions, types etc.
A simple user instruction on how to pass arguments through the command line.
public std::vector< std::string >
optionNames
(Option * option) const
Returns the name(s) of a given option.
Each option/flag must have at least one name, be it long or short. This function returns all of them.
public bool
isSet
(Option * option) const
Returns an indicator that the option is set in the parsed batch of arguments.
i.e. if we include "--version" as an argument, the isSet value of that flag is going to be true.
public const std::string &
value
(Option * option) const
Returns the parsed value for the given option.
Each non-flag option has another argument following it. This is stored as the option's value, and returned by this function.
public void
assertIsSet
(Option * option) const
Asserts that the provided option is set in the parsed arguments.
If not, CommandLineParserException is thrown.
class lv::CommandLineParserException
class lv::CommandLineParserException
: public lv::Exception
A simple exception class for the command line parser, with message and code params.
Summary
Members | Descriptions |
---|---|
public inline CommandLineParserException (const std::string & message, Exception::Code code) |
Default constructor for this exception. |
Members
public inline
CommandLineParserException
(const std::string & message,
Exception::Code
code)
Default constructor for this exception.
class lv::Exception
class lv::Exception
: public exception
Standard Exception used throughout Livekeys.
Contains an internal private object in accordance with the D-pointer design pattern. Currently the structure contains typical Exception parameters such as message, line number, function name, stack trace etc.
Summary
Members | Descriptions |
---|---|
public Exception (const std::string & message, Code code) |
Standard exception constructor with message and code parameters. |
public Exception (const Exception & other) |
Copy constructor of the Exception class. |
public Exception & operator= (const Exception & other) |
Assignment operator of Exception, works in a similar way to a copy constructor. |
public virtual ~Exception () |
Simple destructor of Exception object. |
public bool hasLocation () const |
Returns an indicator if the exception contains a line number where the exception happened. |
public bool hasStackTrace () const |
Indicates if the stack trace was included in the Exception. |
public const std::string & message () const |
Returns the Exception message. |
public Code
code () const |
Returns the Exception code. |
public int line () const |
Returns the line where the exception was thrown. |
public const std::string & file () const |
Returns the filepath of the file where the exception was thrown. |
public std::string fileName () const |
Extracts filename from given filepath and returns it. |
public const std::string & functionName () const |
Returns the function name where the exception was thrown. |
public const StackTrace::Ptr & stackTrace () const |
Returns the full stack trace of the thrown exception. |
public std::string location () const |
Returns string representation of the place where the exception is thrown. |
typedef Code |
unsigned long long |
Members
public
Exception
(const std::string & message,
Code
code)
Standard exception constructor with message and code parameters.
public
Exception
(const
Exception
& other)
Copy constructor of the Exception class.
public
Exception
&
operator=
(const
Exception
& other)
Assignment operator of Exception, works in a similar way to a copy constructor.
public virtual
~Exception
()
Simple destructor of Exception object.
Deletes the private object given by the D-pointer.
public bool
hasLocation
() const
Returns an indicator if the exception contains a line number where the exception happened.
public bool
hasStackTrace
() const
Indicates if the stack trace was included in the Exception.
public const std::string &
message
() const
Returns the Exception message.
public
Code
code
() const
Returns the Exception code.
public int
line
() const
Returns the line where the exception was thrown.
Should be used together with hasLocation() See also: hasLocation()
public const std::string &
file
() const
Returns the filepath of the file where the exception was thrown.
public std::string
fileName
() const
Extracts filename from given filepath and returns it.
public const std::string &
functionName
() const
Returns the function name where the exception was thrown.
public const
StackTrace::Ptr
&
stackTrace
() const
Returns the full stack trace of the thrown exception.
Note that this is using our internal StackTrace object!
public std::string
location
() const
Returns string representation of the place where the exception is thrown.
Includes function name, file name, line number.
typedef
Code
unsigned long long
class lv::LibraryLoadPath
Class that provides an ability to load libraries given a path (both recursively and non-recursively)
The implementation in the background is reliant on the platform on which we're running Livekeys.
Summary
Members | Descriptions |
---|
Members
class lv::LockedFileIOSession
Handles IO from files in a thread-safe manner.
This class contains a flexible internal representation, in accordance with the D-pointer design pattern. Each file (given by its path) gets a unique file lock (the acquisition and release of locks themselves is guaranteed to be in critical sections as well), and depending on the context, we get either read or write access. There can be multiple readers, but only one writer, at a time.
Summary
Members | Descriptions |
---|---|
public ~LockedFileIOSession () |
LockedFileIOSession destructor. |
public std::string readFromFile (const std::string & path) |
Locks the file (given by its path) for reading and loads up a buffer with its content. |
public bool writeToFile (const std::string & path,const std::string & data) |
Locks the file (given by its path) for writing and writes the given data into it. |
public bool writeToFile (const std::string & path,const char * data,size_t length) |
|
typedef Ptr |
Shared pointer to this class |
Members
public
~LockedFileIOSession
()
LockedFileIOSession destructor.
Deletes the internal mutex and the D-pointer itself.
public std::string
readFromFile
(const std::string & path)
Locks the file (given by its path) for reading and loads up a buffer with its content.
If the file can be opened, the buffer is returned with the entirety of the file's content. If not, an empty string is returned.
public bool
writeToFile
(const std::string & path,const std::string & data)
Locks the file (given by its path) for writing and writes the given data into it.
Write lock means that only the singular writer can access it. If the file exists and it's possible to write in it, the given data is writen in, and a true flag is returned. If not, we return false. The return value is an indicator of a successful write.
public bool
writeToFile
(const std::string & path,const char * data,size_t length)
typedef
Ptr
Shared pointer to this class
class lv::MLNode::BytesType
Internal type strongly related to MLNode, as one of the types.
Summary
Members | Descriptions |
---|---|
public BytesType (unsigned char * data,size_t size) |
Constructor from data. |
public BytesType (const BytesType & other) |
Copy constructor of BytesType. |
public BytesType () |
Default constructor of BytesType. |
public ~BytesType () |
Destructor of BytesType. |
public BytesType & operator= (const BytesType & other) |
Assignment operator for BytesType. |
public bool operator== (const BytesType & other) const |
Equals relational operator for BytesType. |
public QByteArray toBase64 () |
Returns a byte array base64 representation of BytesType object. |
public StringType
toBase64String () |
Returns a base64 string representation of the BytesType. |
public ByteType * data () |
Returns the actual data array. |
public size_t size () const |
Returns the size of the BytesType array. |
Members
public
BytesType
(unsigned char * data,size_t size)
Constructor from data.
Params are an array of unsigned chars and its size, both copied. A reference counter is included in order to implement shallow copies of this object.
public
BytesType
(const
BytesType
& other)
Copy constructor of BytesType.
Creates only a shallow copy by copying pointers and incrementing the reference counter.
public
BytesType
()
Default constructor of BytesType.
Initializes the object with zeroes.
public
~BytesType
()
Destructor of BytesType.
We decrement the ref counter. If the ref counter is zero, we delete the pointers.
public
BytesType
&
operator=
(const
BytesType
& other)
Assignment operator for BytesType.
Reference counters are updated, and the pointers are copied from one to the other object.
public bool
operator==
(const
BytesType
& other) const
Equals relational operator for BytesType.
Compares the respective pointers of two objects to check if they're identical. Shallow comparison only.
public QByteArray
toBase64
()
Returns a byte array base64 representation of BytesType object.
public
StringType
toBase64String
()
Returns a base64 string representation of the BytesType.
public
ByteType
*
data
()
Returns the actual data array.
This data array contains unsigned chars.
public size_t
size
() const
Returns the size of the BytesType array.
class lv::MLNode::Iterator
Iterator to be used when the structure of MLNode supports iteration (i.e. arrays or objects)
Summary
Members | Descriptions |
---|---|
public Iterator ( Pointer object) |
Simple Iterator constructor with allocator traits pointer parameter. |
public Iterator (const Iterator & other) |
Copy constructor of Iterator. |
public inline ~Iterator () |
Default (empty) destructor. |
public Iterator & operator= (const Iterator & other) |
Simple assignment operator, similar to a copy constructor. |
public bool canCompareTo (const Iterator & other) const |
Shows if two iterators can be compared i.e. if they are used on the same MLNode. |
public bool operator== (const Iterator & other) const |
Equals relational operator, checking if two iterators point to the same thing. |
public bool operator!= (const Iterator & other) const |
Not-equals relational operator, a simple negation of the equals operator. |
public bool operator< (const Iterator & other) const |
Less-than relational operator, can only be used with non-object iterators. |
public bool operator<= (const Iterator & other) const |
Less-or-equal relational operator, uses the previously defined less operator. |
public bool operator> (const Iterator & other) const |
Greater-than relational operator, uses the previously defined less-or-equal operator. |
public bool operator>= (const Iterator & other) const |
Greater-or-equal relational operator, uses the previously defined less operator. |
public Iterator & operator++ () |
Increment operator, moves the operator forward by one. |
public Iterator & operator-- () |
Decrement operator, moves the operator backwards by one. |
public Iterator & operator+= ( DifferenceType i) |
Forward offset move operator, moves the iterator forward by the given number of steps. |
public Iterator & operator-= ( DifferenceType i) |
Negative offset move operator, moves the operator backwards by the given number of steps. |
public Iterator
operator+ ( DifferenceType i) |
Offset addition operator, using the previously defined forward offset move operator. |
public Iterator
operator- ( DifferenceType i) |
Offset subtraction operator, using the previously defined backwards offset move operator. |
public DifferenceType
operator- (const Iterator & other) const |
Returns difference between two Array iterators. |
public Reference
operator* () const |
Dereference operator, returns the MLNode the iterator's positioned at. |
public Pointer
operator-> () const |
Arrow operator, returns the address of the MLNode the iterator's positioned at. |
public Reference
operator[] ( DifferenceType i) const |
Index operator, can only be used for Array MLNodes. |
public ObjectType::key_type key () const |
Returns the key of the MLNode in an Object that the iterator's currently positioned at. |
public Reference
value () const |
See the dereference operator above. |
typedef DifferenceType |
Identical to MLNode::DifferenceType. |
typedef ValueType |
Identical to MLNode::ValueType. |
typedef Reference |
Identical to MLNode::Reference. |
typedef Pointer |
Identical to MLNode::Pointer. |
typedef ConstPointer |
Identical to MLNode::ConstPointer. |
typedef IteratorCategory |
The standard random access iterator tag. |
Members
public
Iterator
(
Pointer
object)
Simple Iterator constructor with allocator traits pointer parameter.
public
Iterator
(const
Iterator
& other)
Copy constructor of Iterator.
public inline
~Iterator
()
Default (empty) destructor.
public
Iterator
&
operator=
(const
Iterator
& other)
Simple assignment operator, similar to a copy constructor.
public bool
canCompareTo
(const
Iterator
& other) const
Shows if two iterators can be compared i.e. if they are used on the same MLNode.
public bool
operator==
(const
Iterator
& other) const
Equals relational operator, checking if two iterators point to the same thing.
public bool
operator!=
(const
Iterator
& other) const
Not-equals relational operator, a simple negation of the equals operator.
public bool
operator<
(const
Iterator
& other) const
Less-than relational operator, can only be used with non-object iterators.
Objects iterators cannot be compared!
public bool
operator<=
(const
Iterator
& other) const
Less-or-equal relational operator, uses the previously defined less operator.
public bool
operator>
(const
Iterator
& other) const
Greater-than relational operator, uses the previously defined less-or-equal operator.
public bool
operator>=
(const
Iterator
& other) const
Greater-or-equal relational operator, uses the previously defined less operator.
public
Iterator
&
operator++
()
Increment operator, moves the operator forward by one.
public
Iterator
&
operator--
()
Decrement operator, moves the operator backwards by one.
public
Iterator
&
operator+=
(
DifferenceType
i)
Forward offset move operator, moves the iterator forward by the given number of steps.
Cannot be used with objects!
public
Iterator
&
operator-=
(
DifferenceType
i)
Negative offset move operator, moves the operator backwards by the given number of steps.
Uses the already implemented forward offset move. Cannot be used with objects!
public
Iterator
operator+
(
DifferenceType
i)
Offset addition operator, using the previously defined forward offset move operator.
public
Iterator
operator-
(
DifferenceType
i)
Offset subtraction operator, using the previously defined backwards offset move operator.
public
DifferenceType
operator-
(const
Iterator
& other) const
Returns difference between two Array iterators.
Can't be used with any other MLNode type!
public
Reference
operator*
() const
Dereference operator, returns the MLNode the iterator's positioned at.
public
Pointer
operator->
() const
Arrow operator, returns the address of the MLNode the iterator's positioned at.
public
Reference
operator[]
(
DifferenceType
i) const
Index operator, can only be used for Array MLNodes.
public ObjectType::key_type
key
() const
Returns the key of the MLNode in an Object that the iterator's currently positioned at.
public
Reference
value
() const
See the dereference operator above.
typedef
DifferenceType
Identical to MLNode::DifferenceType.
typedef
ValueType
Identical to MLNode::ValueType.
typedef
Reference
Identical to MLNode::Reference.
typedef
Pointer
Identical to MLNode::Pointer.
typedef
ConstPointer
Identical to MLNode::ConstPointer.
typedef
IteratorCategory
The standard random access iterator tag.
class lv::MLNode::ConstIterator
Constant version of the regular MLNode iterator.
Summary
Members | Descriptions |
---|---|
public ConstIterator ( ConstPointer object) |
Const version of MLNode::Iterator default constructor. |
public ConstIterator (const Iterator & other) |
Constructor of ConstIterator from regular Iterator. |
public ConstIterator (const ConstIterator & other) |
Const version of MLNode::Iterator copy constructor. |
public inline ~ConstIterator () |
Default (empty) destructor. |
public ConstIterator & operator= (const ConstIterator & other) |
Const version of MLNode::Iterator default constructor. |
public bool canCompareTo (const ConstIterator & other) const |
Shows if two ConstIterators can be compared i.e. they iterate through the same object. |
public bool operator== (const ConstIterator & other) const |
Equals relational operator that checks if two iterators points at the same pos. |
public bool operator!= (const ConstIterator & other) const |
Not-equals relational operator for ConstIterator. |
public bool operator< (const ConstIterator & other) const |
Const version of the MLNode::Iterator::operator<. |
public bool operator<= (const ConstIterator & other) const |
Const version of the MLNode::Iterator::operator<=. |
public bool operator> (const ConstIterator & other) const |
Const version of the MLNode::Iterator::operator> |
public bool operator>= (const ConstIterator & other) const |
Const version of the MLNode::Iterator::operator>=. |
public ConstIterator & operator++ () |
Const version of the MLNode::Iterator::operator++. |
public ConstIterator & operator-- () |
Const version of the MLNode::Iterator::operator--. |
public ConstIterator & operator+= ( DifferenceType i) |
Const version of the MLNode::Iterator::operator+=. |
public ConstIterator & operator-= ( DifferenceType i) |
Const version of the MLNode::Iterator::operator-=. |
public ConstIterator
operator+ ( DifferenceType i) |
Const version of the MLNode::Iterator::operator+. |
public ConstIterator
operator- ( DifferenceType i) |
Const version of the MLNode::Iterator::operator- for subtracting an offset from the iterator. |
public DifferenceType
operator- (const ConstIterator & other) const |
Const version of the MLNode::Iterator::operator- for two ConstIterators. |
public ConstReference
operator* () const |
Const version of the MLNode::Iterator::operator*. |
public ConstPointer
operator-> () const |
Const version of the MLNode::Iterator::operator-> |
public ConstReference
operator[] ( DifferenceType i) const |
Const version of the MLNode::Iterator::operator[]. |
public ObjectType::key_type key () const |
Const version of the key fetching function for MLNode::Iterator. |
public ConstReference
value () const |
Const version of the value fetching function for MLNode::Iterator. |
typedef DifferenceType |
Identical to MLNode::DifferenceType. |
typedef ValueType |
Identical to MLNode::ValueType. |
typedef Reference |
Identical to MLNode::Reference. |
typedef ConstReference |
Identical to MLNode::ConstReference. |
typedef Pointer |
Identical to MLNode::Pointer. |
typedef ConstPointer |
Identical to MLNode::ConstPointer. |
typedef IteratorCategory |
Standard random access iterator tag. |
Members
public
ConstIterator
(
ConstPointer
object)
Const version of MLNode::Iterator default constructor.
public
ConstIterator
(const
Iterator
& other)
Constructor of ConstIterator from regular Iterator.
public
ConstIterator
(const
ConstIterator
& other)
Const version of MLNode::Iterator copy constructor.
public inline
~ConstIterator
()
Default (empty) destructor.
public
ConstIterator
&
operator=
(const
ConstIterator
& other)
Const version of MLNode::Iterator default constructor.
public bool
canCompareTo
(const
ConstIterator
& other) const
Shows if two ConstIterators can be compared i.e. they iterate through the same object.
public bool
operator==
(const
ConstIterator
& other) const
Equals relational operator that checks if two iterators points at the same pos.
public bool
operator!=
(const
ConstIterator
& other) const
Not-equals relational operator for ConstIterator.
public bool
operator<
(const
ConstIterator
& other) const
Const version of the MLNode::Iterator::operator<.
public bool
operator<=
(const
ConstIterator
& other) const
Const version of the MLNode::Iterator::operator<=.
public bool
operator>
(const
ConstIterator
& other) const
Const version of the MLNode::Iterator::operator>
public bool
operator>=
(const
ConstIterator
& other) const
Const version of the MLNode::Iterator::operator>=.
public
ConstIterator
&
operator++
()
Const version of the MLNode::Iterator::operator++.
public
ConstIterator
&
operator--
()
Const version of the MLNode::Iterator::operator--.
public
ConstIterator
&
operator+=
(
DifferenceType
i)
Const version of the MLNode::Iterator::operator+=.
public
ConstIterator
&
operator-=
(
DifferenceType
i)
Const version of the MLNode::Iterator::operator-=.
public
ConstIterator
operator+
(
DifferenceType
i)
Const version of the MLNode::Iterator::operator+.
public
ConstIterator
operator-
(
DifferenceType
i)
Const version of the MLNode::Iterator::operator- for subtracting an offset from the iterator.
public
DifferenceType
operator-
(const
ConstIterator
& other) const
Const version of the MLNode::Iterator::operator- for two ConstIterators.
public
ConstReference
operator*
() const
Const version of the MLNode::Iterator::operator*.
public
ConstPointer
operator->
() const
Const version of the MLNode::Iterator::operator->
public
ConstReference
operator[]
(
DifferenceType
i) const
Const version of the MLNode::Iterator::operator[].
public ObjectType::key_type
key
() const
Const version of the key fetching function for MLNode::Iterator.
public
ConstReference
value
() const
Const version of the value fetching function for MLNode::Iterator.
typedef
DifferenceType
Identical to MLNode::DifferenceType.
typedef
ValueType
Identical to MLNode::ValueType.
typedef
Reference
Identical to MLNode::Reference.
typedef
ConstReference
Identical to MLNode::ConstReference.
typedef
Pointer
Identical to MLNode::Pointer.
typedef
ConstPointer
Identical to MLNode::ConstPointer.
typedef
IteratorCategory
Standard random access iterator tag.
class lv::MLNode::IteratorValue
Structure of the result returned by the iterator.
Summary
Members | Descriptions |
---|---|
public ObjectType::iterator objectIterator |
Iterator in case of an object |
public ArrayType::iterator arrayIterator |
Iterator in case of an array |
public bool primitiveIterator |
Non-iterator for other types of nodes |
Members
public ObjectType::iterator
objectIterator
Iterator in case of an object
public ArrayType::iterator
arrayIterator
Iterator in case of an array
public bool
primitiveIterator
Non-iterator for other types of nodes
class lv::MLNode::ConstIteratorValue
Structure of the result returned by the const iterator.
Summary
Members | Descriptions |
---|---|
public ObjectType::const_iterator objectIterator |
Iterator in case of an object |
public ArrayType::const_iterator arrayIterator |
Iterator in case of an array |
public bool primitiveIterator |
Non-iterator for other types of nodes |
Members
public ObjectType::const_iterator
objectIterator
Iterator in case of an object
public ArrayType::const_iterator
arrayIterator
Iterator in case of an array
public bool
primitiveIterator
Non-iterator for other types of nodes
class lv::MLNode
Provides an intermediate representation of objects that can later be converted to a markup language.
MLNode provides a wrapper node representation of generally used types, such as ints, floats, bools, strings, arrays and objects, as well as a special type of bytes, which represents an array of unsigned chars to be used as a form of data stream. Object and Array MLNodes can contain other MLNodes inside of them, which provides nesting capabilites e.g. you could have an Array of Objects which map other Arrays. In a way, it's a simple, generic type of node to represent a variety of data objects. The ML abbreviation hints at its purpose, to be used for conversion to markup languages.
MLNodes can be created through numerous constructors
MLNode() // MLNode::Null
MLNode("str") // MLNode::String
MLNode(MLNode::StringType() // MLNode::String
MLNode(200) // MLNode::Integer
MLNode(200.2) // MLNode::Float
MLNode(true) // MLNode::Boolean
MLNode(MLNode::BytesType()) // MLNode::Bytes
MLNode(MLNode::ObjectType)) // MLNode::Object
MLNode(MLNode::ArrayType()) // MLNode::Array
MLNode n({100, 200, 300}); // MLNode::Array
MLNode nObject({
{"object", "value"}
}); // MLNode::Object
They can be initialized during assignment in simple and intuitive ways
MLNode n = 100; // MLNode::Integer
MLNode n = 100.20; // MLNode::Float
MLNode n = {100, 200, 300}; // MLNode::Array
MLNode n = {
{"object", {
{"key1", "value1"},
{"key2", 100}
}},
{"array", { 100, "200", false}},
{"bool", true},
{"int", 100},
{"float", 100.1}
}; // MLNode::Object
The simplest depiction of the inner structure of MLNode would be a simple type variable, indicating which MLNode we have ( See also: enum MLNode::Type), as well as a flexible union type as its value. This union is as small as possible, containing primitive types as is, and using appropriate pointers for larger objects. Knowing the type, we can always use the value by simply accessing the appropriate union field e.g. asObject, asInt. Simplified version of that union is displayed below.
union MLValue{
ObjectType* asObject;
ArrayType* asArray;
BytesType* asBytes;
StringType* asString;
BoolType asBool;
IntType asInt;
FloatType asFloat;
// ... constructors for each type ...
};
For each of these types, there exists an appropriate getter function which casts the value to a correct type. In case of a mismatch, an exception is thrown.
Arrays are a linear type of MLNode containing other MLNodes, which allows combinations of data types which usually can't be contained in a standard container. As seen above, they can easily be constructed via a simple initializer list. Othe array-like behaviours are supported as well, such as iterating, indexing, appending etc.
Objects are simply collections (maps) of string-MLNode pairs, where each MLNode can be accessed by its key i.e. its name. There are several examples above on how to construct a simple object. Object type supports a map-like indexing access, as well as iteration.
MLNode to JSON
We provide several functions to convert our MLNode representation to JSON.
void toJson(const MLNode& n, std::string& result);
void fromJson(const std::string& data, MLNode& n);
void fromJson(const char* data, MLNode& n);
We are able to convert in both directions, from an MLNode to a JSON string, and vice versa (noting that the JSON string can be either a standard string or a char array.
Converting the following object
MLNode n = {
{"object", {
{"string", "value1"},
{"key2", 100}
}},
{"array", { 100, "200", false}},
{"bool", true},
{"int", 100},
{"float", 100.1},
{"null", nullptr}
};
to JSON would return the following JSON string (formatted for clarity)
{
"array": [100,"200",false],
"bool": true,
"float": 100.1,
"int": 100,
"null": null,
"object": {
"key2": 100,
"string": "value1"
}
}
Summary
Members | Descriptions |
---|---|
public MLNode () |
The default constructor of MLNode. |
public MLNode (const std::initializer_list< MLNode > & init) |
MLNode constructor with a parameter of initializer list. |
public MLNode (std::nullptr_t) |
nullptr constructor |
public MLNode (const char * value) |
Constructor of String MLNode given a C-type string i.e. an array of chars. |
public MLNode (const StringType & value) |
Constructor of String MLNode given a StringType-string (currently std::string). |
public MLNode ( MLNode::Type value) |
Constructor of a generic MLNode of a given type. |
public MLNode (int value) |
Constructor of Integer MLNode given an int. |
public MLNode ( IntType value) |
Constructor of Integer MLNode given an IntType (currently long long). |
public MLNode (float value) |
Constructor of a Float MLNode given a float value. |
public MLNode ( FloatType value) |
Constructor of Float MLNode given a FloatType (currently double). |
public MLNode ( BoolType value) |
Constructor of Boolean MLNode given a BoolType (i.e. the one and only bool). |
public MLNode (const BytesType & value) |
Contructor of Bytes MLNode given a BytesType value. |
public MLNode ( MLNode::ByteType * value,size_t size) |
Constructor of Bytes MLNode given an array of unsigned chars and the number of them. |
public MLNode (const ArrayType & value) |
Constructor of Array MLNode given a vector of MLNodes. |
public MLNode (const ObjectType & value) |
Constructor of Object MLNode given a map of string-MLNode pairs. |
public MLNode (const MLNode & other) |
Copy constructor of the MLNode type. |
public MLNode ( MLNode && other) |
Move constructor of the MLNode type. |
public ~MLNode () |
Destructor of MLNode type. |
public const MLNode & operator[] (const StringType & reference) const |
Index operator of Object MLNode that returns a const reference. |
public MLNode & operator[] (const StringType & reference) |
Index operator of Object MLNode, uses a key as reference. |
public const MLNode & operator[] (int index) const |
Index operator of Array MLNode that returns a const reference. |
public MLNode & operator[] (int index) |
Index operator of Array MLNode. |
public inline MLNode & operator= ( MLNode other) |
Assignment operator of MLNode implementing move semantics. |
public void append (const MLNode & value) |
Appends to an Array MLNode. |
public inline Type
type () const |
Returns the type of MLNode. |
public bool isNull () const |
Indicates if the MLNode is of Null type. |
public int asInt () const |
Returns the MLNode value as int. |
public bool asBool () const |
Returns the MLNode value as bool. |
public FloatType
asFloat () const |
Returns the MLNode value as float. |
public const StringType & asString () const |
Returns the MLNode value as string. |
public BytesType
asBytes () const |
Returns the MLNode value as bytes. |
public const ArrayType & asArray () const |
Returns the MLNode value as an array. |
public ArrayType & asArray () |
Returns the MLNode value as an array. |
public const ObjectType & asObject () const |
Returns the MLNode value as an object. |
public int size () const |
Returns the size of MLNode, if it's an Object or Array. |
public bool hasKey (const StringType & key) const |
Returns an indicator that the given key is found in our Object MLNode. |
public void remove (const StringType & key) |
Removes a key-value pair from an Object MLNode with the given key. |
public void remove (int key) |
Removes a key from an Array MLNode with the given key. |
public std::string typeString () const |
Returns a string representation of each MLNode type. |
public std::string toString (int indent,int indentStep) const |
Returns a string representation of an MLNode, indented with a given number of blank spaces. |
public Iterator
begin () |
Returns the appropriate begin-iterator depending on the underlying MLNode type. |
public Iterator
end () |
Returns the appropriate end-iterator depending on the underlying MLNode type. |
public ConstIterator
begin () const |
See cbegin() |
public ConstIterator
end () const |
See cend() |
public ConstIterator
cbegin () const |
Returns the appropriate const begin-iterator depending on the underlying MLNode type. |
public ConstIterator
cend () const |
Returns the appropriate const end-iterator depending on the underlying MLNode type. |
enum Type |
Collection of all possible MLNode types. |
typedef ValueType |
MLNode |
typedef Reference |
Reference to MLNode |
typedef ConstReference |
Const reference to MLNode |
typedef AllocatorType |
Allocator for MLNode |
typedef DifferenceType |
Pointer arithmetic difference type |
typedef SizeType |
Standard size type |
typedef Pointer |
Allocator pointer to MLNode |
typedef ConstPointer |
Const allocator pointer to MLNode |
typedef IntType |
Generic int type (specifically long long) |
typedef FloatType |
Generic float type (specifically double |
typedef BoolType |
bool |
typedef StringType |
Standard string type |
typedef ArrayType |
Vector of MLNodes |
typedef ObjectType |
Map of string-MLNode pairs |
typedef ByteType |
Byte type i.e. unsigned char |
Members
public
MLNode
()
The default constructor of MLNode.
Assigns the Null type and blank value.
public
MLNode
(const std::initializer_list<
MLNode
> & init)
MLNode constructor with a parameter of initializer list.
Can be used to initialize both arrays and objects, given as key-value pairs in the form of two-member arrays. For example, {1, 2, 3} would initialize a simple Int array, and {{"one", 1},{"two", 2},{"three", 3}} would initialize an object.
public
MLNode
(std::nullptr_t)
nullptr constructor
Used to create a Null-type MLNode. Equivalent to the default constructor.
public
MLNode
(const char * value)
Constructor of String MLNode given a C-type string i.e. an array of chars.
public
MLNode
(const
StringType
& value)
Constructor of String MLNode given a StringType-string (currently std::string).
public
MLNode
(
MLNode::Type
value)
Constructor of a generic MLNode of a given type.
public
MLNode
(int value)
Constructor of Integer MLNode given an int.
public
MLNode
(
IntType
value)
Constructor of Integer MLNode given an IntType (currently long long).
public
MLNode
(float value)
Constructor of a Float MLNode given a float value.
public
MLNode
(
FloatType
value)
Constructor of Float MLNode given a FloatType (currently double).
public
MLNode
(
BoolType
value)
Constructor of Boolean MLNode given a BoolType (i.e. the one and only bool).
public
MLNode
(const
BytesType
& value)
Contructor of Bytes MLNode given a BytesType value.
public
MLNode
(
MLNode::ByteType
* value,size_t size)
Constructor of Bytes MLNode given an array of unsigned chars and the number of them.
public
MLNode
(const
ArrayType
& value)
Constructor of Array MLNode given a vector of MLNodes.
public
MLNode
(const
ObjectType
& value)
Constructor of Object MLNode given a map of string-MLNode pairs.
The strings represent the keys, while the other pair component is any type of MLNode.
public
MLNode
(const
MLNode
& other)
Copy constructor of the MLNode type.
public
MLNode
(
MLNode
&& other)
Move constructor of the MLNode type.
public
~MLNode
()
Destructor of MLNode type.
Depending on the underlying type, we invoke the destructor on the appropriate pointer.
public const
MLNode
&
operator[]
(const
StringType
& reference) const
Index operator of Object MLNode that returns a const reference.
Throws an exception in case of non-Object type, and unlike a similar index operator, returns an immutable reference.
public
MLNode
&
operator[]
(const
StringType
& reference)
Index operator of Object MLNode, uses a key as reference.
If used on a non-Object type, throws an exception.
public const
MLNode
&
operator[]
(int index) const
Index operator of Array MLNode that returns a const reference.
Difference from the other index operator is that this returns an immutable reference.
public
MLNode
&
operator[]
(int index)
Index operator of Array MLNode.
The underlying type has to be an array, otherwise an exception is thrown.
public inline
MLNode
&
operator=
(
MLNode
other)
Assignment operator of MLNode implementing move semantics.
public void
append
(const
MLNode
& value)
Appends to an Array MLNode.
In case of using it on a non-Array MLNode, an exception is thrown.
public inline
Type
type
() const
Returns the type of MLNode.
public bool
isNull
() const
Indicates if the MLNode is of Null type.
public int
asInt
() const
Returns the MLNode value as int.
If not the appropriate type, an exception is thrown.
public bool
asBool
() const
Returns the MLNode value as bool.
Throws exception if node is not of bool type.
public
FloatType
asFloat
() const
Returns the MLNode value as float.
Throws exception if node is not of float type.
public const
StringType
&
asString
() const
Returns the MLNode value as string.
Throws exception if node is not of string type.
public
BytesType
asBytes
() const
Returns the MLNode value as bytes.
This can be done with both byte and string types. In case of the string type, it's converted to base 64 and then assigned to bytes. If not Bytes or String type, an exception is thrown.
public const
ArrayType
&
asArray
() const
Returns the MLNode value as an array.
The array is actually a vector of MLNodes. If not the appropriate type, an exception is thrown.
public
ArrayType
&
asArray
()
Returns the MLNode value as an array.
The array is actually a vector of MLNodes. If not the appropriate type, an exception is thrown.
public const
ObjectType
&
asObject
() const
Returns the MLNode value as an object.
If not the appropriate type, an exception is thrown.
public int
size
() const
Returns the size of MLNode, if it's an Object or Array.
When an Array, the appropriate vector size is returned. When an Object, the number of mapped pairs is returned. If not one of those types, zero is returned.
public bool
hasKey
(const
StringType
& key) const
Returns an indicator that the given key is found in our Object MLNode.
If the node is not an Object, an exception is thrown.
public void
remove
(const
StringType
& key)
Removes a key-value pair from an Object MLNode with the given key.
If the node is not an Object, an exception is thrown.
public void
remove
(int key)
Removes a key from an Array MLNode with the given key.
If the node is not an Array, an exception is thrown
public std::string
typeString
() const
Returns a string representation of each MLNode type.
public std::string
toString
(int indent,int indentStep) const
Returns a string representation of an MLNode, indented with a given number of blank spaces.
This uses the previously defined toStringImpl(), which prints out the given MLNode to the given stream, whilepassing a stringstream.
public
Iterator
begin
()
Returns the appropriate begin-iterator depending on the underlying MLNode type.
Types that allow iteration are Object and Array only.
public
Iterator
end
()
Returns the appropriate end-iterator depending on the underlying MLNode type.
Types that allow iteration are Object and Array only.
public
ConstIterator
begin
() const
See cbegin()
public
ConstIterator
end
() const
See cend()
public
ConstIterator
cbegin
() const
Returns the appropriate const begin-iterator depending on the underlying MLNode type.
Types that allow iteration are Object and Array only.
public
ConstIterator
cend
() const
Returns the appropriate const end-iterator depending on the underlying MLNode type.
Types that allow iteration are Object and Array only.
enum
Type
Values | Descriptions |
---|---|
Null | Null type |
Object | Object type - map of string-MLNode pairs |
Array | Array type - vector of MLNodes |
Bytes | Bytes type - vector of unsigned chars (1B each!) |
String | String type - encapsulation of the standard string |
Boolean | Boolean type - encapsulation of bool |
Integer | Integer type - whole numbers |
Float | Float type - decimal numbers |
Collection of all possible MLNode types.
typedef
ValueType
typedef
Reference
Reference to MLNode
typedef
ConstReference
Const reference to MLNode
typedef
AllocatorType
Allocator for MLNode
typedef
DifferenceType
Pointer arithmetic difference type
typedef
SizeType
Standard size type
typedef
Pointer
Allocator pointer to MLNode
typedef
ConstPointer
Const allocator pointer to MLNode
typedef
IntType
Generic int type (specifically long long)
typedef
FloatType
Generic float type (specifically double
typedef
BoolType
bool
typedef
StringType
Standard string type
typedef
ArrayType
Vector of MLNodes
typedef
ObjectType
Map of string-MLNode pairs
typedef
ByteType
Byte type i.e. unsigned char
class lv::MLOutOfRanceException
class lv::MLOutOfRanceException
: public lv::Exception
Out-of-range exception.
Summary
Members | Descriptions |
---|---|
public inline MLOutOfRanceException (const std::string & message,int code) |
Default contructor |
Members
public inline
MLOutOfRanceException
(const std::string & message,int code)
Default contructor
class lv::InvalidMLTypeException
class lv::InvalidMLTypeException
: public lv::Exception
Invalid ML type exception.
Summary
Members | Descriptions |
---|---|
public inline InvalidMLTypeException (const std::string & message,int code) |
Default contructor |
Members
public inline
InvalidMLTypeException
(const std::string & message,int code)
Default contructor
class lv::TypeNotSerializableException
class lv::TypeNotSerializableException
: public lv::Exception
Type not serializible exception.
Summary
Members | Descriptions |
---|---|
public inline TypeNotSerializableException (const std::string & message,int code) |
Default constructor |
Members
public inline
TypeNotSerializableException
(const std::string & message,int code)
Default constructor
class lv::Package::Reference
Stores a reference to another package.
Contains just a name and version
Summary
Members | Descriptions |
---|---|
public Utf8
name |
Reference name |
public Version
version |
Reference version |
public inline Reference (const std::string & n, Version v) |
Default constructor |
Members
public
Utf8
name
Reference name
public
Version
version
Reference version
public inline
Reference
(const std::string & n,
Version
v)
Default constructor
class lv::Package::Library
A structure representing a package library.
A structure representing a project entry within this package.
When we import the package, LiveKeys will also load the library We can have issues with different versions of the same library. This is manager through flags, strings which indicate support of particular features. We compare flag sets or two libraries in order to provide maximum support of features.
Summary
Members | Descriptions |
---|---|
public Utf8
name |
Package name |
public Utf8
path |
Package path |
public Version
version |
Package version |
public std::list< std::string > flags |
Package flags |
public inline Library (const std::string & n, Version v) |
Default constructor |
public FlagResult
compareFlags (const Library & other) |
Function that compares two sets of flags in order for us to select a better library |
enum FlagResult |
Flag comparation results |
Members
public
Utf8
name
Package name
public
Utf8
path
Package path
public
Version
version
Package version
public std::list< std::string >
flags
Package flags
public inline
Library
(const std::string & n,
Version
v)
Default constructor
public
FlagResult
compareFlags
(const
Library
& other)
Function that compares two sets of flags in order for us to select a better library
enum
FlagResult
Values | Descriptions |
---|---|
Equal | Two libraries have same flags |
HasLess | The first library has less flags than the other one (it's a subset) |
HasMore | The first library has more flags than the other one (it's a superset) |
Different | Two sets of flags are not comparable |
Flag comparation results
class lv::Package::Context
Presents a context for the given package in relation to the package graph.
Summary
Members | Descriptions |
---|
Members
class lv::Package
class lv::Package
: private lv::Package::Context
Manages a Livekeys package.
Summary
Members | Descriptions |
---|---|
public PackageGraph * packageGraph |
Package graph |
public std::list< Package::Ptr > dependents |
Packages dependent on the current one |
public std::list< Package::Ptr > dependencies |
Dependencies of the package |
public std::map< std::string, Plugin::Ptr > plugins |
Plugins |
public ~Package () |
Destructor of Package. |
public const std::string & name () const |
Returns the package name. |
public const std::string & path () const |
Returns the package path. |
public const std::string & filePath () const |
Returns the filepath of the package. |
public const std::string & documentation () const |
Returns the package documentation. |
public const Version & version () const |
Returns the package version. |
public const std::map< std::string, Package::Reference * > & dependencies () const |
Returns a map of dependencies with string keys |
public const std::map< std::string, Package::Library * > & libraries () const |
Returns a map of libraries with string keys. |
public void assignContext ( PackageGraph * graph) |
Assigns a new context to this package. |
public PackageGraph * contextOwner () |
Package graph. |
public Context * context () |
Returns the current context if any has been assigned, nullptr otherwise. |
public bool hasWorkspace () const |
|
public const std::string & workspaceLabel () const |
|
public const std::vector< std::pair< std::string, std::string > > & workspaceTutorialsSections () const |
|
public const std::vector< ProjectEntry > & workspaceSamples () |
|
public inline Context () |
Blank constructor |
typedef Ptr |
Shared pointer to Package |
typedef ConstPtr |
Const shared pointer to the Package |
Members
public
PackageGraph
*
packageGraph
Package graph
public std::list<
Package::Ptr
>
dependents
Packages dependent on the current one
public std::list<
Package::Ptr
>
dependencies
Dependencies of the package
public std::map< std::string,
Plugin::Ptr
>
plugins
Plugins
public
~Package
()
Destructor of Package.
public const std::string &
name
() const
Returns the package name.
public const std::string &
path
() const
Returns the package path.
public const std::string &
filePath
() const
Returns the filepath of the package.
public const std::string &
documentation
() const
Returns the package documentation.
public const
Version
&
version
() const
Returns the package version.
public const std::map< std::string,
Package::Reference
* > &
dependencies
() const
Returns a map of dependencies with string keys
public const std::map< std::string,
Package::Library
* > &
libraries
() const
Returns a map of libraries with string keys.
public void
assignContext
(
PackageGraph
* graph)
Assigns a new context to this package.
public
PackageGraph
*
contextOwner
()
Package graph.
public
Context
*
context
()
Returns the current context if any has been assigned, nullptr otherwise.
public bool
hasWorkspace
() const
public const std::string &
workspaceLabel
() const
public const std::vector< std::pair< std::string, std::string > > &
workspaceTutorialsSections
() const
public const std::vector<
ProjectEntry
> &
workspaceSamples
()
public inline
Context
()
Blank constructor
typedef
Ptr
typedef
ConstPtr
Const shared pointer to the Package
class lv::PackageGraph::LibraryNode
Struct to represent a library node.
Summary
Members | Descriptions |
---|---|
public Package::Library
library |
Library within the node |
public bool loaded |
Shows if it's loaded |
public inline LibraryNode (const Package::Library & l) |
Default constructor |
Members
public
Package::Library
library
Library within the node
public bool
loaded
Shows if it's loaded
public inline
LibraryNode
(const
Package::Library
& l)
Default constructor
class lv::PackageGraph
Structure to represent packages and their dependencies.
It also stores all the libraries, stores in the LibraryNode structure. We also check for dependency cycles on multiple levels: plugins, packages, Elements files
Summary
Members | Descriptions |
---|---|
public PackageGraph () |
Default constructor |
public virtual ~PackageGraph () |
Default destructor |
public void loadPackage (const Package::Ptr & p,bool addLibraries) |
Loads package in the graph and makes necessary checks |
public void loadPackageWithDependencies (const Package::Ptr & p,std::list< Package::Reference > & missing,bool addLibraries) |
Recursive loader that also loads the necessarys dependencies |
public void addDependency (const Package::Ptr & package,const Package::Ptr & dependsOn) |
Adds the dependency needed for this plugin. If not within the same package, we load an entire package instead. |
public CyclesResult< Package::Ptr > checkCycles (const Package::Ptr & p) |
Check if there are cycles between packages, starting from the given packages |
public CyclesResult< Plugin::Ptr > checkCycles (const Plugin::Ptr & p) |
Check if there are cycles between plugins, starting from the given plugin |
public void clearPackages () |
Clears all packages from the graph. |
public void clearLibraries () |
Clears all libraries from the graph. |
public void addLibrary (const Package::Library & lib) |
Adds a library for loading. |
public void loadLibraries () |
Function that loads all the libraries from our internal libraries structure |
public std::string toString () const |
Nice string representation of the PackageGraph. |
public Package::Ptr
findPackage ( Package::Reference ref) const |
Finds the package according to the given reference. |
public Package::Ptr
findPackage (const std::string & packageName) const |
Finds the package with the given name and the highest version in the package import paths. |
public Package::Ptr
findLoadedPackage (const std::string & name) |
|
public Package::ConstPtr
findLoadedPackage (const std::string & name) const |
|
public Package::Ptr
package (const std::string & name) |
Returns the package with the given name internally |
public Package::ConstPtr
package (const std::string & name) const |
|
public const std::vector< std::string > & packageImportPaths () const |
Returns the package import paths |
public void setPackageImportPaths (const std::vector< std::string > & paths) |
Package import paths setter |
public Plugin::Ptr
createRunningPlugin (const std::string & path) |
|
public void loadRunningPackageAndPlugin (const Package::Ptr & package,const Plugin::Ptr & plugin) |
|
public Plugin::Ptr
loadPlugin (const std::string & importSegment, Plugin::Ptr requestingPlugin) |
Load plugin given the import segment. |
public Plugin::Ptr
loadPlugin (const std::vector< std::string > & importSegment, Plugin::Ptr requestingPlugin) |
Loads plugin given split-up import segments. |
public void addDependency (const Plugin::Ptr & plugin,const std::string & pluginDependency) |
Adds plugin dependency. |
public void addDependency (const Plugin::Ptr & plugin,const Plugin::Ptr & dependsOn) |
Add dependency between two given plugins. |
public PaletteContainer * paletteContainer () const |
Members
public
PackageGraph
()
Default constructor
public virtual
~PackageGraph
()
Default destructor
public void
loadPackage
(const
Package::Ptr
& p,bool addLibraries)
Loads package in the graph and makes necessary checks
public void
loadPackageWithDependencies
(const
Package::Ptr
& p,std::list<
Package::Reference
> & missing,bool addLibraries)
Recursive loader that also loads the necessarys dependencies
public void
addDependency
(const
Package::Ptr
& package,const
Package::Ptr
& dependsOn)
Adds the dependency needed for this plugin. If not within the same package, we load an entire package instead.
public CyclesResult<
Package::Ptr
>
checkCycles
(const
Package::Ptr
& p)
Check if there are cycles between packages, starting from the given packages
public CyclesResult<
Plugin::Ptr
>
checkCycles
(const
Plugin::Ptr
& p)
Check if there are cycles between plugins, starting from the given plugin
public void
clearPackages
()
Clears all packages from the graph.
public void
clearLibraries
()
Clears all libraries from the graph.
public void
addLibrary
(const
Package::Library
& lib)
Adds a library for loading.
The library is loaded if:
the library hasn't been loaded yet
the library currently provided is a newer version than the existing one, or has more compilation flags that include the existing one and the older one hasn't been cached (loaded into memory) yet
A few conditions must be respected, otherwise an exception will be triggered:
If another library already has been loaded, then the major version must be the same as the one that was loaded
If another library already has been loaded, then the added library must have either more or less compilation flags than the one added
If it has less compilation flags, than the minor version must be smaller or equal to the the added library
If it has more compliation flags, than the minor version must be higher or equal to the added library
public void
loadLibraries
()
Function that loads all the libraries from our internal libraries structure
public std::string
toString
() const
Nice string representation of the PackageGraph.
public
Package::Ptr
findPackage
(
Package::Reference
ref) const
Finds the package according to the given reference.
public
Package::Ptr
findPackage
(const std::string & packageName) const
Finds the package with the given name and the highest version in the package import paths.
public
Package::Ptr
findLoadedPackage
(const std::string & name)
public
Package::ConstPtr
findLoadedPackage
(const std::string & name) const
public
Package::Ptr
package
(const std::string & name)
Returns the package with the given name internally
public
Package::ConstPtr
package
(const std::string & name) const
public const std::vector< std::string > &
packageImportPaths
() const
Returns the package import paths
public void
setPackageImportPaths
(const std::vector< std::string > & paths)
Package import paths setter
public
Plugin::Ptr
createRunningPlugin
(const std::string & path)
public void
loadRunningPackageAndPlugin
(const
Package::Ptr
& package,const
Plugin::Ptr
& plugin)
public
Plugin::Ptr
loadPlugin
(const std::string & importSegment,
Plugin::Ptr
requestingPlugin)
Load plugin given the import segment.
public
Plugin::Ptr
loadPlugin
(const std::vector< std::string > & importSegment,
Plugin::Ptr
requestingPlugin)
Loads plugin given split-up import segments.
public void
addDependency
(const
Plugin::Ptr
& plugin,const std::string & pluginDependency)
Adds plugin dependency.
public void
addDependency
(const
Plugin::Ptr
& plugin,const
Plugin::Ptr
& dependsOn)
Add dependency between two given plugins.
public
PaletteContainer
*
paletteContainer
() const
class lv::Plugin::Context
Presents a context for the given plugin in relation to the package graph.
Summary
Members | Descriptions |
---|
Members
class lv::Plugin
class lv::Plugin
: private lv::Plugin::Context
Manages a Livekeys plugin.
Summary
Members | Descriptions |
---|---|
public PackageGraph * packageGraph |
Package graph |
public Package::Ptr
package |
Package |
public std::string importId |
Import id |
public std::list< Plugin::Ptr > localDependencies |
Local dependencies |
public std::list< Plugin::Ptr > localDependents |
Local dependents |
public ~Plugin () |
Default destructor |
public const std::string & name () const |
Name getter |
public const std::string & path () const |
Path getter |
public const std::string & filePath () const |
File path getter |
public const std::string & package () const |
Package getter |
public const std::list< std::string > & dependencies () const |
Dependencies getter |
public const std::list< std::string > & modules () const |
Modules getter |
public const std::list< std::string > & libraryModules () const |
Library modules getter |
public const std::list< std::pair< std::string, std::string > > & palettes () const |
Palettes getter |
public void assignContext ( PackageGraph * graph) |
Assign package graph context |
public Context * context () |
Context getter |
public inline Context () |
Blank constructor |
typedef Ptr |
Shared pointer to plugin |
Members
public
PackageGraph
*
packageGraph
Package graph
public
Package::Ptr
package
public std::string
importId
Import id
public std::list<
Plugin::Ptr
>
localDependencies
Local dependencies
public std::list<
Plugin::Ptr
>
localDependents
Local dependents
public
~Plugin
()
Default destructor
public const std::string &
name
() const
Name getter
public const std::string &
path
() const
Path getter
public const std::string &
filePath
() const
File path getter
public const std::string &
package
() const
Package getter
public const std::list< std::string > &
dependencies
() const
Dependencies getter
public const std::list< std::string > &
modules
() const
Modules getter
public const std::list< std::string > &
libraryModules
() const
Library modules getter
public const std::list< std::pair< std::string, std::string > > &
palettes
() const
Palettes getter
public void
assignContext
(
PackageGraph
* graph)
Assign package graph context
public
Context
*
context
()
Context getter
public inline
Context
()
Blank constructor
typedef
Ptr
Shared pointer to plugin
class lv::StackTrace
Captures and holds a stacktrace.
Summary
Members | Descriptions |
---|---|
public inline ConstIterator
begin () const |
Start iterator or the stackframes |
public inline ConstIterator
end () const |
End iterator of the stackframes |
public inline size_t size () const |
Number of stackframes |
public ~StackTrace () |
Destructor of StackTrace. |
typedef Container |
vector of StackFrames |
typedef ConstIterator |
Const iterator for a stack frame vector |
typedef Ptr |
Shared pointer to StackTrace |
Members
public inline
ConstIterator
begin
() const
Start iterator or the stackframes
public inline
ConstIterator
end
() const
End iterator of the stackframes
public inline size_t
size
() const
Number of stackframes
public
~StackTrace
()
Destructor of StackTrace.
Simply removes the contained StackFrames.
typedef
Container
vector of StackFrames
typedef
ConstIterator
Const iterator for a stack frame vector
typedef
Ptr
Shared pointer to StackTrace
class lv::StackFrame
A frame of debug-related data that gets pushed to the stack trace.
Very simple structure, containing only getters of its various fields.
Summary
Members | Descriptions |
---|---|
public inline StackFrame (const std::string & functionName, AddressPtr address,const std::string & objectPath,const std::string & filePath,int line) |
Default constructor, only function name and addr. pointer are mandatory parameters. |
public inline ~StackFrame () |
Default (empty) destructor. |
public inline const std::string & functionName () const |
Function name getter. |
public inline AddressPtr
address () const |
Adress pointer getter. |
public inline const std::string & objectPath () const |
Object path getter. |
public inline const std::string & filePath () const |
File path getter. |
public inline std::string fileName () const |
File name getter (extracted from file path) |
public inline int line () const |
Line number getter. |
public inline bool hasLocation () const |
Shows if we have a line number field. |
typedef AddressPtr |
unsigned long long |
Members
public inline
StackFrame
(const std::string & functionName,
AddressPtr
address,const std::string & objectPath,const std::string & filePath,int line)
Default constructor, only function name and addr. pointer are mandatory parameters.
public inline
~StackFrame
()
Default (empty) destructor.
public inline const std::string &
functionName
() const
Function name getter.
public inline
AddressPtr
address
() const
Adress pointer getter.
public inline const std::string &
objectPath
() const
Object path getter.
public inline const std::string &
filePath
() const
File path getter.
public inline std::string
fileName
() const
File name getter (extracted from file path)
public inline int
line
() const
Line number getter.
public inline bool
hasLocation
() const
Shows if we have a line number field.
typedef
AddressPtr
unsigned long long
class lv::Version
Semantic version container.
The version is represented by four values: major version, minor version, patch number, revision number, in order of importance. Version is stored as a single long long value, and the four components can then be extracted by simple modular arithmetic modulo 10000.
Summary
Members | Descriptions |
---|---|
public Version (int majorNumber,int minorNumber,int patchNumber,int revisionNumber) |
A simple version constructor containing four number parameters in order of importance. |
public Version (const std::string & versionStr) |
A simple constructor from string in format major.minor.patch.revision. |
public ~Version () |
Version destructor (blank) |
public inline int majorNumber () const |
Returns major version. |
public inline int minorNumber () const |
Returns minor version. |
public inline int patchNumber () const |
Returns patch number. |
public inline int revisionNumber () const |
Returns revision number. |
public inline bool operator== (const Version & version) const |
Equals relational operator between two versions. |
public inline bool operator!= (const Version & version) const |
Not-equals relational operator between two versions. |
public inline bool operator< (const Version & version) const |
Less-than relational operator between two versions. |
public inline bool operator<= (const Version & version) const |
Less-or-equal relational operator between two versions. |
public inline bool operator> (const Version & version) const |
Greater-than relational operator between two versions. |
public inline bool operator>= (const Version & version) const |
Greater-or-equal relational operator between two versions. |
public std::string toString () const |
String representation of version, in the form of major.minor.patch[.revision]. |
Members
public
Version
(int majorNumber,int minorNumber,int patchNumber,int revisionNumber)
A simple version constructor containing four number parameters in order of importance.
Any number of parameters is allowed, the rest default to 0. All numbers except the major version are limited to four digits max by design.
public
Version
(const std::string & versionStr)
A simple constructor from string in format major.minor.patch.revision.
We can include 0-4 numbers in the string representation, and they will be used in order of importance i.e. if we only have three numbers, we will default the revision number to 0. See also: Version(int major, int minor, int patch, int revision)
public
~Version
()
Version destructor (blank)
public inline int
majorNumber
() const
Returns major version.
public inline int
minorNumber
() const
Returns minor version.
public inline int
patchNumber
() const
Returns patch number.
public inline int
revisionNumber
() const
Returns revision number.
public inline bool
operator==
(const
Version
& version) const
Equals relational operator between two versions.
Simple check between two long longs!
public inline bool
operator!=
(const
Version
& version) const
Not-equals relational operator between two versions.
Simple check between two long longs!
public inline bool
operator<
(const
Version
& version) const
Less-than relational operator between two versions.
Equivalent to the check between two long longs!
public inline bool
operator<=
(const
Version
& version) const
Less-or-equal relational operator between two versions.
Simple check between two long longs!
public inline bool
operator>
(const
Version
& version) const
Greater-than relational operator between two versions.
Simple check between two long longs!
public inline bool
operator>=
(const
Version
& version) const
Greater-or-equal relational operator between two versions.
Equivalent to the check between two long longs!
public std::string
toString
() const
String representation of version, in the form of major.minor.patch[.revision].
Revision is only included if it's non-zero! Other components are extracted with their respective functions
class lv::VisualLog::MessageInfo
Simple wrapper class for log messages, including the level, timestamp and location info.
Location info includes a remote, function name, line number and file name. All of these are optional.
Summary
Members | Descriptions |
---|---|
public ~MessageInfo () |
MessageInfo desctructor. |
public inline std::string sourceRemoteLocation () const |
Returns a remote location, if it exists. |
public inline std::string sourceFileName () const |
Returns the file name of the source, if it exists. |
public inline int sourceLineNumber () const |
Returns the line number, if it has been set. |
public inline std::string sourceFunctionName () const |
Returns the name of the source function, if it has been set. |
public const QDateTime & stamp () const |
Returns the message info timestamp. |
public std::string prefix (const VisualLog::Configuration * configuration) const |
Returns a prefix extracted from a given configuration object. |
public std::string tag (const VisualLog::Configuration * configuration) const |
Returns the tag which is actually the name of the given configuration. |
public Level
level () const |
Return the level of this message. |
enum Level |
Collection of all possible message levels, in decreasing order of importance. |
Members
public
~MessageInfo
()
MessageInfo desctructor.
Deletes location and stamp pointers.
public inline std::string
sourceRemoteLocation
() const
Returns a remote location, if it exists.
public inline std::string
sourceFileName
() const
Returns the file name of the source, if it exists.
public inline int
sourceLineNumber
() const
Returns the line number, if it has been set.
public inline std::string
sourceFunctionName
() const
Returns the name of the source function, if it has been set.
public const QDateTime &
stamp
() const
Returns the message info timestamp.
If there's none, it takes the current time and sets it as the stamp.
public std::string
prefix
(const VisualLog::Configuration * configuration) const
Returns a prefix extracted from a given configuration object.
public std::string
tag
(const VisualLog::Configuration * configuration) const
Returns the tag which is actually the name of the given configuration.
public
Level
level
() const
Return the level of this message.
enum
Level
Values | Descriptions |
---|---|
Fatal | |
Error | |
Warning | |
Info | |
Debug | |
Verbose |
Collection of all possible message levels, in decreasing order of importance.
class lv::VisualLog::SourceLocation
Simple structure containing relevant data about a location of the source.
Location info includes a remote, function name, line number and file name. All of these are optional.
Summary
Members | Descriptions |
---|---|
public std::string remote |
Remote |
public std::string file |
Source file |
public int line |
Source line |
public std::string functionName |
Function name |
public inline SourceLocation (const std::string & file,int line,const std::string & fileName) |
Default contructor |
public inline SourceLocation (const std::string & remote,const std::string & file,int line,const std::string & functionName) |
Contructor with a remote |
Members
public std::string
remote
Remote
public std::string
file
Source file
public int
line
Source line
public std::string
functionName
Function name
public inline
SourceLocation
(const std::string & file,int line,const std::string & fileName)
Default contructor
public inline
SourceLocation
(const std::string & remote,const std::string & file,int line,const std::string & functionName)
Contructor with a remote
class lv::VisualLog::Transport
Abstraction of the transport used to pass non-visual/object messages.
Summary
Members | Descriptions |
---|---|
public inline virtual ~Transport () |
|
public void onMessage (const VisualLog::Configuration * configuration,const VisualLog::MessageInfo & messageInfo,const std::string & message) |
Declaration of the onMessage method |
public void onObject (const VisualLog::Configuration * configuration,const VisualLog::MessageInfo & messageInfo,const std::string & type,const MLNode & node) |
Declaration of the onObject method |
Members
public inline virtual
~Transport
()
public void
onMessage
(const VisualLog::Configuration * configuration,const
VisualLog::MessageInfo
& messageInfo,const std::string & message)
Declaration of the onMessage method
public void
onObject
(const VisualLog::Configuration * configuration,const
VisualLog::MessageInfo
& messageInfo,const std::string & type,const
MLNode
& node)
Declaration of the onObject method
class lv::VisualLog::ViewTransport
Abstraction of the transport used to pass visual (view) messages.
Summary
Members | Descriptions |
---|---|
public inline virtual ~ViewTransport () |
|
public void onMessage (const VisualLog::Configuration * configuration,const VisualLog::MessageInfo & messageInfo,const std::string & message) |
Declaration of the onMessage method |
public void onView (const VisualLog::Configuration * configuration,const VisualLog::MessageInfo & messageInfo,const std::string & viewName,const QVariant & value) |
Declaration of the onView method |
Members
public inline virtual
~ViewTransport
()
public void
onMessage
(const VisualLog::Configuration * configuration,const
VisualLog::MessageInfo
& messageInfo,const std::string & message)
Declaration of the onMessage method
public void
onView
(const VisualLog::Configuration * configuration,const
VisualLog::MessageInfo
& messageInfo,const std::string & viewName,const QVariant & value)
Declaration of the onView method
class lv::VisualLog
Main logging class.
The way we primarily use this class is through a predefined macro vlog
. It's defined in the following way
lv::VisualLog(__VA_ARGS__).at(__FILE__, __LINE__, __FUNCTION__)
This means that we can pass arguments to the vlog macro that are in accordance with the constructors of VisualLog. Those are:
VisualLog();
VisualLog(MessageInfo::Level level);
VisualLog(const std::string& configuration);
VisualLog(const std::string& configuration, MessageInfo::Level level);
Therefore, we can pass no arguments, or we can pass a configuration string (also known as tag), or a default message level, or both. The at(...) function arguments provide us with the file, line number and function name of the place we're invoking the vlog call.
Six levels of logging are available, in order of importance: Fatal, Error, Warning, Info, Debug, Verbose. There's a global configuration of the logger available, but there's also the ability to create a special configuration paired to a user-provided tag. Each user-created configuration starts as a global configuration - we can then change individual parameters as desired. vlog(extension)
would create a configuration with the tag "extension". Perhaps the most important parameters of the configuration are the message levels. Each configuration has an application level and a default message level. If the level of the message we're logging is of less importance than the application level, it will not be displayed. We can set the level of the message in the following way
vlog(extension).f() << "fatal"
vlog(extension).e() << "error"
vlog(extension).w() << "warning"
vlog(extension).i() << "info"
vlog(extension).d() << "debug"
vlog(extension).v() << "verbose"
Invoking one of the shorthand functions changes the message level of the logger. The default message level is info, while the application level is debug. An example on how to configure the custom configuration is given below.
vlog().configure("test", {
{"level", VisualLog::MessageInfo::Error},
{"defaultLevel", VisualLog::MessageInfo::Info}
});
The above would change the application level of the logger to Error, and the default message level to Info. Messages would not get displayed for this particular configuration! The options are given as an Object MLNode ( See also: MLNode). All the relevant options are listed below:
level - application level, the least important message level that the logger's showing
defaultLevel - default level of messages
file - output log file
logDaily - if the log should be created on a daily basis
toConsole - if the log messages should be passed to the console
toExtensions - if the log messages should be passed to other transports
toView - if the log messages should be passed to view
logObjects - set flags for places where we should log objects
prefix - formatted message prefix, depends on preset values (explained below)
These settings can also be modified through the command line arguments (see help). We can output our logged messages in several ways: Console
, View
, File
and [Extensions](#classlv_1_1Extensions)
. It's important to mention the concept of Transport, which we use an abstraction of a listener picking up on our log messages. We can treat the Console and File as "transports" even though they're not technically extending our abstract class. Transport can broadcast the message in a simple textform, or as an object. View Transports are used to listen to messages which can be displayed in a visual way. If the message isn't in the correct format, or visual logging isn't enabled in the config, we default to a console display. Similarly, a generic transport is used for sending the object to an external listener, be it a file or a network listener. If object logging isn't enabled, or the object isn't in the correct form, we once again default to a console display.
Summary
Members | Descriptions |
---|---|
public VisualLog () |
Default constructor of VisualLog. |
public VisualLog ( MessageInfo::Level level) |
Constructor of VisualLog with level parameter. |
public VisualLog (const std::string & configuration) |
Constructor of VisualLog with configuration parameter. |
public VisualLog (const std::string & configuration, MessageInfo::Level level) |
Constructor of VisualLog with both configuration and level parameters. |
public ~VisualLog () |
Destructor of VisualLog. |
public inline VisualLog & at (const std::string & file,int line,const std::string & functionName) |
Sets the message info location. |
public inline VisualLog & at (const std::string & remote,const std::string & file,int line,const std::string & functionName) |
Sets the message info location with remote included. |
public VisualLog & overrideStamp (const QDateTime & stamp) |
Overrides the previous timestamp with the given one. |
public template<> VisualLog & operator<< (const T & x) |
Stream insertion operator. |
public template<> VisualLog & operator<< (std::ostream &(*)(std::ostream &) f) |
Stream insertion operator with a std::ostream& (*f)(std::ostream&) parameter. |
public template<> VisualLog & operator<< (std::ostream &(*)(std::ios &) f) |
Stream insertion operator with a std::ostream& (*f)(std::ios&) parameter. |
public template<> VisualLog & operator<< (std::ostream(*)(std::ios_base &) f) |
Stream insertion operator with a std::ostream (*f)(std::ios_base& ) parameter. |
public inline VisualLog & f () |
Sets the message level to Fatal. |
public inline VisualLog & e () |
Sets the message level to Error. |
public inline VisualLog & w () |
Sets the message level to Warning. |
public inline VisualLog & i () |
Sets the message level to Info. |
public inline VisualLog & d () |
Sets the message level to Debug. |
public inline VisualLog & v () |
Sets the message level to Verbose. |
public template<> void object (const T & value) |
Log given value as object. |
public template<> void f (const T & value) |
Log given value as object with level Fatal. |
public template<> void e (const T & value) |
Log given value as object with level Error. |
public template<> void w (const T & value) |
Log given value as object with level Warning. |
public template<> void i (const T & value) |
Log given value as object with level Info. |
public template<> void d (const T & value) |
Log given value as object with level Debug. |
public template<> void v (const T & value) |
Log given value as object with level Verbose. |
public bool canLog () |
Shows if logging is enabled. |
public void configure (const std::string & configuration,const MLNode & options) |
Configure VisualLog given a configuration tag and options. |
public void configure (VisualLog::Configuration * configuration,const MLNode & options) |
Configure VisualLog given the configuration data and options. |
public void addTransport (const std::string & configuration, Transport * transport) |
Adds transport given a predefined configuration. |
public void addTransport (VisualLog::Configuration * configuration, Transport * transport) |
Adds transport given configuration data. |
public void removeTransports (const std::string & configuration) |
Removes transport given a predefined configuration. |
public void removeTransports (VisualLog::Configuration * configuration) |
Removes transport given configuration data. |
public int totalConfigurations () |
Returns total number of configurations. |
public void flushLine () |
Flushes the entire buffer to preset outputs. |
public void closeFile () |
Closes the internal log file. |
public void asView (const std::string & viewPath,const QVariant & viewData) |
Display viewData in the View given by the viewPath. |
public void asView (const std::string & viewPath,std::function< QVariant()> cloneFunction) |
Display view data returned by the given function in the View given by the viewPath. |
public template<> void asObject (const std::string & type,const T & value) |
Display value as object of given type. |
public void asObject (const std::string & type,const MLNode & value) |
Display MLNode as object of given type. |
enum Output |
Bitmasks for each type of output |
Members
public
VisualLog
()
Default constructor of VisualLog.
public
VisualLog
(
MessageInfo::Level
level)
Constructor of VisualLog with level parameter.
public
VisualLog
(const std::string & configuration)
Constructor of VisualLog with configuration parameter.
public
VisualLog
(const std::string & configuration,
MessageInfo::Level
level)
Constructor of VisualLog with both configuration and level parameters.
public
~VisualLog
()
Destructor of VisualLog.
public inline
VisualLog
&
at
(const std::string & file,int line,const std::string & functionName)
Sets the message info location.
public inline
VisualLog
&
at
(const std::string & remote,const std::string & file,int line,const std::string & functionName)
Sets the message info location with remote included.
public
VisualLog
&
overrideStamp
(const QDateTime & stamp)
Overrides the previous timestamp with the given one.
public template<>
VisualLog
&
operator<<
(const T & x)
Stream insertion operator.
public template<>
VisualLog
&
operator<<
(std::ostream &(*)(std::ostream &) f)
Stream insertion operator with a std::ostream& (*f)(std::ostream&) parameter.
public template<>
VisualLog
&
operator<<
(std::ostream &(*)(std::ios &) f)
Stream insertion operator with a std::ostream& (*f)(std::ios&) parameter.
public template<>
VisualLog
&
operator<<
(std::ostream(*)(std::ios_base &) f)
Stream insertion operator with a std::ostream (*f)(std::ios_base& ) parameter.
public inline
VisualLog
&
f
()
Sets the message level to Fatal.
public inline
VisualLog
&
e
()
Sets the message level to Error.
public inline
VisualLog
&
w
()
Sets the message level to Warning.
public inline
VisualLog
&
i
()
Sets the message level to Info.
public inline
VisualLog
&
d
()
Sets the message level to Debug.
public inline
VisualLog
&
v
()
Sets the message level to Verbose.
public template<>
void
object
(const T & value)
Log given value as object.
public template<>
void
f
(const T & value)
Log given value as object with level Fatal.
public template<>
void
e
(const T & value)
Log given value as object with level Error.
public template<>
void
w
(const T & value)
Log given value as object with level Warning.
public template<>
void
i
(const T & value)
Log given value as object with level Info.
public template<>
void
d
(const T & value)
Log given value as object with level Debug.
public template<>
void
v
(const T & value)
Log given value as object with level Verbose.
public bool
canLog
()
Shows if logging is enabled.
public void
configure
(const std::string & configuration,const
MLNode
& options)
Configure VisualLog given a configuration tag and options.
public void
configure
(VisualLog::Configuration * configuration,const
MLNode
& options)
Configure VisualLog given the configuration data and options.
public void
addTransport
(const std::string & configuration,
Transport
* transport)
Adds transport given a predefined configuration.
public void
addTransport
(VisualLog::Configuration * configuration,
Transport
* transport)
Adds transport given configuration data.
public void
removeTransports
(const std::string & configuration)
Removes transport given a predefined configuration.
public void
removeTransports
(VisualLog::Configuration * configuration)
Removes transport given configuration data.
public int
totalConfigurations
()
Returns total number of configurations.
public void
flushLine
()
Flushes the entire buffer to preset outputs.
public void
closeFile
()
Closes the internal log file.
public void
asView
(const std::string & viewPath,const QVariant & viewData)
Display viewData in the View given by the viewPath.
public void
asView
(const std::string & viewPath,std::function< QVariant()> cloneFunction)
Display view data returned by the given function in the View given by the viewPath.
public template<>
void
asObject
(const std::string & type,const T & value)
Display value as object of given type.
public void
asObject
(const std::string & type,const
MLNode
& value)
Display MLNode as object of given type.
enum
Output
Values | Descriptions |
---|---|
Console | Console output |
Error | Error output |
File | File output |
View | View output |
Extensions | Extentions output |
Bitmasks for each type of output