Skip to article frontmatterSkip to article content
MembersDescriptions
namespace g3pg3p namespace

namespace g3p

The main namespace of G3P library.

Summary

MembersDescriptions
static const std::string endg3p::end manipulator
static const std::string endlg3p::endl manipulator
static const std::string eodg3p::eod manipulator
const std::stringflushg3p::flush manipulator
template<>
std::string make_data_block(const gnuplot& gp, const T& c)
Returns a data block for the gnuplot instance
template<>
std::string make_data_block(const gnuplot& gp,const T& c, typename T::size_type row, typename T::size_type sep)
Returns a data block for the gnuplot instance
nlohmann::json mime_bundle_repr(const gnuplot & gp)Overloaded function for mime representation in a Jupyter Notebook’s cell (only available in cling)
void display(const gnuplot& gp,bool clear_ouput)Displays the gnuplot in the notebook (only available in cling)
class gnuplotEncapsulation of a Gnuplot instance

Members

static const std::string end

Manipulator for sending end-of-data stream signal to Gnuplot instance.

static const std::string endl

Manipulator for sending end of line character and flushing the buffer.

static const std::string eod

Manipulator for sending start/end of a datablock to Gnuplot instance.

static const std::string flush

Manipulator for flushing the buffer.

template<T>
std::string make_data_block(const gnuplot& gp, const T& c)

Helper function that returns a data block for the gnuplot instance.

Type Parameters
TType of the object to be converted to a data block
Parameters
gpReference to the gnuplot instance
cReference to the object to be converted to a data block
Return
std::stringA string representing the name of the data block

template<T>
std::string make_data_block(const gnuplot& gp, const T& c, typename T::size_type row, typename T::size_type sep)

Helper function that returns a data block for the gnuplot instance.

Type Parameters
TType of the container to be converted to a data block
Parameters
gpReference to the gnuplot instance
cReference to the container to be converted to a data block
rowNumber of elements in each row
sepNumber of rows to separate the data block
Return
std::stringA string representing the name of the data block

nlohmann::json mime_bundle_repr(const gnuplot& gp)

Overloaded function for mime representation in a Jupyter Notebook’s cell (only available in cling)

Parameters
gpConstant reference to a gnuplot instance
Return
nlohmann::jsonA json mime representation

void display(const gnuplot& gp, bool clear_ouput)

Displays the gnuplot in the notebook (only available in cling).

Parameters
gpReference to the gnuplot instance
clear_outputA boolean indicating whether the output should be cleared (default = true)

class gnuplot

The one and only class in G3P that encapsulates a Gnuplot instance.

Summary

MembersDescriptions
gnuplot(bool persist,std::string logfile)Default constructor
~gnuplot()Destructor
double version()Returns the version of gnuplot excluding the patchlevel
std::string version_string()Returns the version and patchlevel of gnuplot
std::string patchlevel()Returns the patchlevel of gnuplot
std::string log(size_t line_count) constReturns the content of the log file
std::string plotfile() constReturns the name of the plot file (only available in cling)
const gnuplot& sync() constWaits for the gnuplot to finish processing the commands
template<>
const gnuplot& operator()(Args &&... args) const
Sends the arguments to the gnuplot instance
template<>
const gnuplot& operator<<(T arg) const
Sends the argument to the gnuplot instance
std::istringstream operator>>(size_t line_count) constReads the output of the gnuplot instance
const gnuplot& endl() constSends an end-of-line to the gnuplot instance
const gnuplot& end() constSends an end-of-data to the gnuplot instance
const gnuplot& flush() constSends a flush command to the gnuplot instance

Members

gnuplot(bool persist, std::string logfile)

Default constructor

Parameters
persistA boolean indicating whether the gnuplot instance should be persistent (default = true)
logfileA string representing the name of the log file (default = {})

~gnuplot()

Destructor

double version()

Returns the version of gnuplot excluding the patchlevel

Return
doubleA double representing the version of gnuplot

std::string version_string()

Returns the version and patchlevel of gnuplot

Return
std::stringA string representing the version and patchlevel of gnuplot

std::string patchlevel()

Returns the patchlevel of gnuplot

Return
std::stringA string representing the patchlevel of gnuplot

std::string log(size_t line_count) const

Returns the content of the log file

Parameters
line_countNumber of lines to return from the end of the log file. The whole log file if 0. (default = 0)
Return
std::stringA string representing the content of the log file

std::string plotfile() const

Returns the name of the plot file (only available in cling)

Return
std::stringA string representing the name of the plot file

const gnuplot& sync() const

Waits for the gnuplot to finish processing the commands

Return
const gnuplot&A constant reference to the gnuplot object

template<>
const gnuplot& operator()(Args &&... args) const

Sends the arguments to the gnuplot instance

Parameters
argsArguments to be sent to the gnuplot instance
Return
const gnuplot&A constant reference to the gnuplot object

template<>
const gnuplot& operator<<(T arg) const

Sends the argument to the gnuplot instance

Parameters
argArgument to be sent to the gnuplot instance
Return
const gnuplot&A constant reference to the gnuplot object

std::istringstream operator>>(size_t line_count) const

Reads the output of the gnuplot instance

Parameters
line_countNumber of lines to read from the end of the output
Return
std::istringstreamA stringstream containing the output of the gnuplot instance

const gnuplot& endl() const

Sends an end-of-line to the gnuplot instance

Return
const gnuplot&A constant reference to the gnuplot object

const gnuplot& end() const

Sends an end-of-data to the gnuplot instance

Return
const gnuplot&A constant reference to the gnuplot object

const gnuplot& flush() const

Sends a flush command to the gnuplot instance

Return
const gnuplot&A constant reference to the gnuplot object