| Members | Descriptions |
|---|---|
namespace g3p | g3p namespace |
namespace g3p¶
g3p¶The main namespace of G3P library.
Summary¶
| Members | Descriptions |
|---|---|
static const std::string end | g3p::end manipulator |
static const std::string endl | g3p::endl manipulator |
static const std::string eod | g3p::eod manipulator |
const std::stringflush | g3p::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 gnuplot | Encapsulation of a Gnuplot instance |
Members¶
static const std::string endl¶
static const std::string endl¶Manipulator for sending end of line character and flushing the buffer.
template<T>
std::string make_data_block(const gnuplot& gp, const T& c)¶
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 | |
|---|---|
T | Type of the object to be converted to a data block |
| Parameters | |
|---|---|
gp | Reference to the gnuplot instance |
c | Reference to the object to be converted to a data block |
| Return | |
|---|---|
std::string | A 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)¶
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 | |
|---|---|
T | Type of the container to be converted to a data block |
| Parameters | |
|---|---|
gp | Reference to the gnuplot instance |
c | Reference to the container to be converted to a data block |
row | Number of elements in each row |
sep | Number of rows to separate the data block |
| Return | |
|---|---|
std::string | A string representing the name of the data block |
nlohmann::json mime_bundle_repr(const gnuplot& gp)¶
nlohmann::json mime_bundle_repr(const gnuplot& gp)¶Overloaded function for mime representation in a Jupyter Notebook’s cell (only available in cling)
| Parameters | |
|---|---|
gp | Constant reference to a gnuplot instance |
| Return | |
|---|---|
nlohmann::json | A json mime representation |
class gnuplot¶
gnuplot¶The one and only class in G3P that encapsulates a Gnuplot instance.
Summary¶
| Members | Descriptions |
|---|---|
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) const | Returns the content of the log file |
std::string plotfile() const | Returns the name of the plot file (only available in cling) |
const gnuplot& sync() const | Waits 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) const | Reads the output of the gnuplot instance |
const gnuplot& endl() const | Sends an end-of-line to the gnuplot instance |
const gnuplot& end() const | Sends an end-of-data to the gnuplot instance |
const gnuplot& flush() const | Sends a flush command to the gnuplot instance |
Members¶
gnuplot(bool persist, std::string logfile)¶
gnuplot(bool persist, std::string logfile)¶Default constructor
| Parameters | |
|---|---|
persist | A boolean indicating whether the gnuplot instance should be persistent (default = true) |
logfile | A string representing the name of the log file (default = {}) |
double version()¶
double version()¶Returns the version of gnuplot excluding the patchlevel
| Return | |
|---|---|
double | A double representing the version of gnuplot |
std::string version_string()¶
std::string version_string()¶Returns the version and patchlevel of gnuplot
| Return | |
|---|---|
std::string | A string representing the version and patchlevel of gnuplot |
std::string patchlevel()¶
std::string patchlevel()¶Returns the patchlevel of gnuplot
| Return | |
|---|---|
std::string | A string representing the patchlevel of gnuplot |
std::string log(size_t line_count) const¶
std::string log(size_t line_count) const¶Returns the content of the log file
| Parameters | |
|---|---|
line_count | Number of lines to return from the end of the log file. The whole log file if 0. (default = 0) |
| Return | |
|---|---|
std::string | A string representing the content of the log file |
std::string plotfile() const¶
std::string plotfile() const¶Returns the name of the plot file (only available in cling)
| Return | |
|---|---|
std::string | A string representing the name of the plot file |
const gnuplot& sync() const¶
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¶
template<> const gnuplot& operator()(Args &&... args) const¶Sends the arguments to the gnuplot instance
| Parameters | |
|---|---|
args | Arguments to be sent to the gnuplot instance |
| Return | |
|---|---|
const gnuplot& | A constant reference to the gnuplot object |
template<>
const gnuplot& operator<<(T arg) const¶
template<> const gnuplot& operator<<(T arg) const¶Sends the argument to the gnuplot instance
| Parameters | |
|---|---|
arg | Argument 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¶
std::istringstream operator>>(size_t line_count) const¶Reads the output of the gnuplot instance
| Parameters | |
|---|---|
line_count | Number of lines to read from the end of the output |
| Return | |
|---|---|
std::istringstream | A stringstream containing the output of the gnuplot instance |
const gnuplot& endl() const¶
const gnuplot& endl() const¶Sends an end-of-line to the gnuplot instance
| Return | |
|---|---|
const gnuplot& | A constant reference to the gnuplot object |