![]() |
librnr
1.14.5
RoadNarrows Robotics Common Library 1
|
Nonsensical example that merely test compiling and linking a C++ applciation agains librnr C library. More...
#include <iostream>#include <string>#include <libgen.h>#include "rnr/rnrconfig.h"#include "rnr/log.h"#include "rnr/opts.h"#include "version.h"#include "rnr/assoc.h"#include "rnr/char.h"#include "rnr/config.h"#include "rnr/dliststr.h"#include "rnr/hash.h"#include "rnr/new.h"Go to the source code of this file.
Enumerations | |
| enum | BodyId_T { unknown, Sun, Mercury, Venus, Earth, Moon, Mars, Phobos, Deimos, Ceres, Jupiter, Io, Europa, Ganymede, Callisto, Saturn, Titan, Uranus, Titania, Neptune, Triton, Pluto, Charon, Eris, NumBodies, unknown, Sun, Mercury, Venus, Earth, Moon, Mars, Phobos, Deimos, Ceres, Jupiter, Io, Europa, Ganymede, Callisto, Saturn, Titan, Uranus, Titania, Neptune, Triton, Pluto, Charon, Eris, NumBodies } |
| Major and minor solar body ids (partial, of course). | |
Functions | |
| static void | logtest_num1 (void *p, const char *sFruit, int n, int half, double f, int hex, bool_t bAreRipe) |
| Log test number 1. More... | |
| static int | logtest_num2 (int count) |
| Log test number 2. More... | |
| static int | runlogtests () |
| Run log test(s). More... | |
| void | test_assoc (BodyId_T oid) |
| Test value to name association. More... | |
| void | test_assoc (const char *name) |
| Test name to value association. More... | |
| void | test_char () |
| Test character routine(s). | |
| void | test_config (string inifile) |
| Test INI configuration routines. | |
| void | test_dlist () |
| Test doubly-linked list routines. | |
| void | del_node_data (void *key, void *val) |
| Delete node data - both key and value are dynamically allocated. More... | |
| void | test_hash () |
| Test hash and new routines. | |
| static int | init (int argc, char *argv[]) |
| Main initialization. More... | |
| int | main (int argc, char *argv[]) |
| Example main. More... | |
Variables | |
| static char * | Argv0 |
| the command | |
| static int | OptsTest = 1 |
| test option value | |
| static OptsPgmInfo_T | LogExamplePgmInfo |
| Program information. More... | |
| static OptsInfo_T | LogExampleOptsInfo [] |
| Nvp_T | SolarBodyNames [] |
| Solar body name-id pairs (partial). More... | |
| static string | Colorado14ers [][2] |
| Colorado's 14,000+ foot mountains. More... | |
Nonsensical example that merely test compiling and linking a C++ applciation agains librnr C library.
$LastChangedDate$ $Rev$
Definition in file example_cpp.cxx.
| void del_node_data | ( | void * | key, |
| void * | val | ||
| ) |
Delete node data - both key and value are dynamically allocated.
| key | Data key. |
| val | Data value. |
Definition at line 410 of file example_cpp.cxx.
Referenced by test_hash().
|
static |
Main initialization.
| argc | Command-line argument count. |
| argv | Command-line argument list. |
Definition at line 465 of file example_cpp.cxx.
References Argv0, CHKEXPR_INT, LOG_GET_LOGFP(), LOG_LEVEL_DIAG1, LOGABLE, LOGDIAG1, OptsGet(), OptsTest, and PkgInfo.
Referenced by main().
|
static |
Log test number 1.
| p | Void pointer. |
| sFruit | Character pointer. |
| n | Integer. |
| half | Short. |
| f | Double. |
| hex | Integer in hex. |
| bAreRipe | Boolean. |
Definition at line 128 of file example_cpp.cxx.
References _TBOOL, _TFLOAT, _THEX, _TINT, _TPTR, _TSHORT, _TSTR, LOGDIAG1CALL, and LOGDIAG2.
Referenced by runlogtests().
|
static |
Log test number 2.
| count | Count. |
Definition at line 151 of file example_cpp.cxx.
References _TINT, LOGDIAG2CALL, LOGDIAG4, LOGERROR, LOGSYSERROR, and NULL.
Referenced by runlogtests().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Example main.
| argc | Command-line argument count. |
| argv | Command-line argument list. |
Definition at line 503 of file example_cpp.cxx.
References init(), runlogtests(), test_assoc(), test_char(), test_config(), test_dlist(), and test_hash().
|
static |
Run log test(s).
Definition at line 182 of file example_cpp.cxx.
References LOGERROR, logtest_num1(), logtest_num2(), and OptsTest.
Referenced by main().
| void test_assoc | ( | BodyId_T | oid | ) |
Test value to name association.
| oid | Value. |
Definition at line 273 of file example_cpp.cxx.
References arraysize, and NvpVal2Name().
Referenced by main().
| void test_assoc | ( | const char * | name | ) |
Test name to value association.
| name | Name. |
Definition at line 285 of file example_cpp.cxx.
References arraysize, and NvpName2Val().
|
static |
Colorado's 14,000+ foot mountains.
N.B. there are 53 of them, I'm stopping at the highest 16.
Definition at line 384 of file example_cpp.cxx.
Referenced by test_hash().
|
static |
Definition at line 93 of file example_cpp.cxx.
|
static |
Program information.
Definition at line 75 of file example_cpp.cxx.
| Nvp_T SolarBodyNames[] |
Solar body name-id pairs (partial).
Definition at line 241 of file example_cpp.cxx.