A simple, scrolling-text stats server. More...
#include "textStats.h"
Public Member Functions | |
virtual PStatMonitor * | make_monitor () |
void | run () |
Public Member Functions inherited from ProgramBase | |
ProgramBase (const std::string &name=std::string()) | |
std::string | get_exec_command () const |
Returns the command that invoked this program, as a shell-friendly string, suitable for pasting into the comments of output files. More... | |
virtual void | parse_command_line (int argc, char **argv) |
Dispatches on each of the options on the command line, and passes the remaining parameters to handle_args(). More... | |
void | show_description () |
Writes the program description to stderr. More... | |
void | show_options () |
Describes each of the available options to stderr. More... | |
void | show_text (const std::string &text) |
Formats the indicated text to stderr with the known _terminal_width. More... | |
void | show_text (const std::string &prefix, int indent_width, std::string text) |
Formats the indicated text and its prefix for output to stderr with the known _terminal_width. More... | |
void | show_usage () |
Writes the usage line(s) to stderr. More... | |
void | write_man_page (std::ostream &out) |
Generates a man page in nroff syntax based on the description and options. More... | |
Public Member Functions inherited from PStatServer | |
void | add_reader (Connection *connection, PStatReader *reader) |
Adds the newly-created PStatReader to the list of currently active readers. More... | |
int | add_user_guide_bar (double height) |
Creates a new user guide bar and returns its index number. More... | |
int | find_user_guide_bar (double from_height, double to_height) const |
Returns the index number of the first user guide bar found whose height is within the indicated range, or -1 if no user guide bars fall within the range. More... | |
int | get_num_user_guide_bars () const |
Returns the current number of user-defined guide bars. More... | |
int | get_udp_port () |
Returns a new port number that will probably be free to use as a UDP port. More... | |
double | get_user_guide_bar_height (int n) const |
Returns the height of the nth user-defined guide bar. More... | |
virtual bool | is_thread_safe () |
This should be redefined to return true in derived classes that want to deal with multithreaded readers and such. More... | |
bool | listen (int port=-1) |
Establishes a port number that the manager will listen on for TCP connections. More... | |
void | main_loop (bool *interrupt_flag=nullptr) |
An alternative to repeatedly calling poll(), this function yields control of the program to the PStatServer. More... | |
void | move_user_guide_bar (int n, double height) |
Adjusts the height of the nth user-defined guide bar. More... | |
void | poll () |
Checks for any network activity and handles it, if appropriate, and then returns. More... | |
void | release_udp_port (int port) |
Indicates that the given UDP port is once again free for use. More... | |
void | remove_reader (Connection *connection, PStatReader *reader) |
Removes the indicated reader. More... | |
void | remove_user_guide_bar (int n) |
Removes the user guide bar with the indicated index number. More... | |
Public Member Functions inherited from ConnectionManager | |
const Interface & | get_interface (size_t n) |
size_t | get_num_interfaces () |
PT (Connection) open_UDP_connection(uint16_t port=0) | |
PT (Connection) open_TCP_client_connection(const NetAddress &address | |
void | scan_interfaces () |
Repopulates the list reported by get_num_interface()/get_interface(). More... | |
bool | wait_for_readers (double timeout) |
Blocks the process for timeout number of seconds, or until any data is available on any of the non-threaded ConnectionReaders or ConnectionListeners, whichever comes first. More... | |
Additional Inherited Members | |
Public Types inherited from ProgramBase | |
typedef pdeque< std::string > | Args |
Static Public Member Functions inherited from ConnectionManager | |
static std::string | get_host_name () |
Public Attributes inherited from ProgramBase | |
Args | _program_args |
Filename | _program_name |
Public Attributes inherited from ConnectionManager | |
PT(Connection) open_UDP_connection(const std int | backlog |
PT(Connection) open_TCP_server_rendezvous(const std int | backlog |
get_host_name | |
Returns the name of this particular machine on the network, if available, or the empty string if the hostname cannot be determined. More... | |
get_interface | |
Returns the nth usable network interface detected on this machine. More... | |
get_num_interfaces | |
This returns the number of usable network interfaces detected on this machine. More... | |
int | timeout_ms |
A simple, scrolling-text stats server.
Guaranteed to compile on every platform.
Definition at line 29 of file textStats.h.