rtop
Classes | Namespaces | Macros | Functions | Variables
rtop_utils.h File Reference
#include <vector>
#include <map>
#include <unistd.h>
#include <algorithm>
#include <ncurses.h>
#include <stdexcept>
#include "params.h"
#include "info.h"
#include "rtop_logger.h"

Go to the source code of this file.

Classes

class  rtop::StringParser
 responsible for parsing strings in a line, specfied by some character separator More...
 

Namespaces

 rtop
 

Macros

#define _BSD_SOURCE
 
#define RTOP_UTILS_H_
 

Functions

template<typename T , typename Compare >
std::vector< int > rtop::sort_permutation (const std::vector< T > &vec, Compare compare)
 returns permutation vector after sorting the given vector based on the provided compare function More...
 
char rtop::toChar (std::string str1)
 converts string to its equivalent char value. More...
 
void rtop::milliSleep (int msec)
 makes calling thread sleep for specified milliseconds More...
 
std::string rtop::msecToTimeStr (unsigned long msec)
 converts msec to TimerStr for display as min:sec.secs_fraction More...
 
template<class T >
std::ostream & rtop::operator<< (std::ostream &ofs, const InfoProc< T > &obj)
 overloaded << operator for printing InfoProc contents More...
 
template<class T >
std::string rtop::vec_to_string (std::vector< T > &vec)
 concatenates a vectors entries into a string More...
 
template<class T >
void rtop::swap (std::vector< T > &v, int i, int j)
 swaps supplied vectors' element corresponding to indices i and j More...
 
template<class T >
void rtop::swap (T &a, T &b)
 swaps two variables More...
 

Variables

src::severity_logger< severity_level > lg
 
logSpacer log_spacer
 
std::map< std::string, int > rtop::color_map {{"BLACK", COLOR_BLACK}, {"RED", COLOR_RED}, {"GREEN", COLOR_GREEN}, {"YELLOW", COLOR_YELLOW}, {"BLUE", COLOR_BLUE}, {"MAGENTA", COLOR_MAGENTA}, {"CYAN", COLOR_CYAN}, {"WHITE", COLOR_WHITE}}
 dictionary containing color_pair number corresponding to each color_name More...
 

Macro Definition Documentation

◆ _BSD_SOURCE

#define _BSD_SOURCE

Definition at line 1 of file rtop_utils.h.

◆ RTOP_UTILS_H_

#define RTOP_UTILS_H_

Definition at line 11 of file rtop_utils.h.

Variable Documentation

◆ lg

src::severity_logger<severity_level> lg

Definition at line 108 of file rtop_logger.h.

◆ log_spacer

logSpacer log_spacer

Definition at line 186 of file rtop_logger.h.