![]() |
VR-Link API Documentation for DIS
|
The vlutil library contains classes and functions which provide an operating system independent interface to commonly used operating system dependant functionality. More...
Collaboration diagram for The VR-Link Utilities Library (vlutil):Classes | |
| class | DtAbsNotifyObserver |
| DtAbsNotifyObserver is an abstract base class. More... | |
| class | DtAssert |
| DtAssert (the class) helps implement DtAssert (the MACRO) by storing static member variables. More... | |
| class | DtBaseMsg |
| A bass class for PDUs and other network messages. More... | |
| class | DtPduFilterTest |
| class | DtDisSocket |
| The DtDisSocket class provides an address family independent datagram socket. More... | |
| class | DtDynamicLibrary |
| DtDynamicLibrary provides an operating independent way to manipulate dynamically loaded libraries. More... | |
| class | DtException |
| DtException is the generic MAK Exception from which all other Exceptions thrown by MAK products are derived. More... | |
| class | DtTemplatedException< I > |
| A Templated version of DtException. More... | |
| class | DtFilename |
| Instances of DtFilename are DtStrings which convert filenames to the native format. More... | |
| class | DtBaseHashKey |
| DtBaseHashKey is an abstract base class for hash keys. More... | |
| class | DtIntHashKey |
| Instances of DtIntHashKey are used as a hash key made from an integer. More... | |
| class | DtPtrHashKey |
| DtPtrHashKey is used as an index into DtHashList where the key is a pointer. More... | |
| class | DtStringHashKey |
| Instances of DtStringHashKey are used as a hash key made from a string. More... | |
| class | DtWStringHashKey |
| Instances of DtWStringHashKey are used as a hash key made from a wide string. More... | |
| class | DtInetAddr |
| Represents a IPv4 or IPv6 address. More... | |
| class | DtInetEndpoint |
| The DtInetEndpoint class provides a protocol independant, address family independent mechanism to represent the IP address, port, and protocol of one end of a network socket connection. More... | |
| class | DtInetSocketProcessingCbInfo |
| class | DtInetSocket |
| The DtInetSocket class provides a protocol independant, address family independant base class for TCP or UDP socket subclasses. More... | |
| class | DtInetTcpSocket |
| The DtInetSocket class provides an address family independent stream socket. More... | |
| class | DtInetUdpSocket |
| An abstract base class to represent a Socket Type. More... | |
| class | DtListItem |
| lint -e266 More... | |
| class | DtList |
| DtList is deprecated, please use std::list<T>. More... | |
| class | DtMutex |
| instances of DtMutex are used to provide a platform independent mutual exclusion mechanism More... | |
| class | DtNetTimeStamp |
| Instances of DtNetTimeStamp are network representations of a DIS time stamp. More... | |
| class | DtNetU16 |
| Network-order unsigned 16-bit quantity. More... | |
| class | DtNetInt16 |
| Network-order signed 16-bit quantity. More... | |
| class | DtNetU32 |
| Network-order unsigned 32-bit quantity. More... | |
| class | DtNetInt32 |
| Network-order signed 32-bit quantity. More... | |
| class | DtNetFloat32 |
| Network-order 32-bit IEEE-754 floating-point quantity. More... | |
| class | DtNetFloat64 |
| Network-order 64-bit IEEE-754 floating-point quantity. More... | |
| class | DtNetU64 |
| A Network byte aligned 64 unsigned integer data structure. More... | |
| class | DtNetInt64 |
| A Network byte aligned 64 integer data structure. More... | |
| class | DtObservee |
| Instances of DtObservee are used to manage interest in this object by other objects, i.e. More... | |
| class | DtTimedSection |
| DtTimedSection are objects used to measure a section of time. More... | |
| class | DtTimeStatistic |
| This object takes time samples and maintains the minimum and maximum as well as a running average of the time samples. More... | |
| class | DtPerformanceStats |
| A stats reporter class is responsible for managing a collection of time stats. More... | |
| class | DtPrinter |
| DtPrinter is an abstract base class which provides an interface for output. More... | |
| class | DtFilePrinter |
| DtFilePrinter is a subclass of DtPrinter which opens a file and dumps all information received from DtOutputStream to the file. More... | |
| class | DtStdoutPrinter |
| DtStdoutPrinter is a subclass of DtPrinter which copies all input received from DtOutputStream to the systems standard output device. More... | |
| class | DtStderrPrinter |
| class DtStderrPrinter is a subclass of DtPrinter which copies all input received from DtOutputStream to the systems standard error device. More... | |
| class | DtOutputStreamBuffer |
| DtOutputStreamBuffer is the internal buffer for DtOutputStream it has no value to VR-Link developers and should not be subclassed or modified. More... | |
| class | DtOutputStream |
| DtOutputStream is used for all toolkit output. More... | |
| class | DtRunnable |
| Declares the DtRunnable class for defining a object that can be run in a thread. More... | |
| class | DtScopedLock |
| DtScopedLock provides a Boost source compatible scoped lock for DtMutex. More... | |
| class | DtSharedMemoryPoolManager |
| This class creates and manages a shared memory pool. More... | |
| class | DtSharedMemoryPoolClient |
| DtSharedMemoryPoolClient is used to attach to and access a previously created memory pool. More... | |
| class | DtString |
| Instances of DtString are used to represent strings. More... | |
| class | DtStringPatternMatch |
| Performs pattern matching against user specified DtString using Boyer Moore algorithm. More... | |
| class | DtThreadStart |
| The thread start object. More... | |
| class | DtThread |
| Abstract Threading Class Provides a system independent thread object. More... | |
| class | DtClock |
| Used to set and maintain time in a simulation. More... | |
| class | DtSelectParam |
| class | DtU128 |
| A Host byte aligned 128 unsigned integer data structure. More... | |
Namespaces | |
| namespace | DtInetUtils |
| Utility functions for manipulating IP addresses. | |
Files | |
| file | vlAbsNotifyObs.h |
| This file declares DtAbsNotifyObserver. | |
| file | vlAssert.h |
| An implementation of DtAssert, and helper classes. | |
| file | vlBaseMsg.h |
| This file provides a declaration of the class DtBaseMsg. | |
| file | vlCliServer.h |
| This file contains definitions common to the Shared Memory Packet Server and its clients. | |
| file | vlDeclNotifier.h |
| Macros useful for creating Notifiers for a DtObservee. | |
| file | vlDir.h |
| This file contains the declaration of several functions for directory manipulation. | |
| file | vlDisSocket.h |
| This file contains the declaration of the DtDisSocket base class. | |
| file | vlDynamic.h |
| This file contains the declaration of DtDynamicLibrary. | |
| file | vlExceptions.h |
| This file declares vlException. | |
| file | vlFedTarget.h |
| This file contains the declaration of DtFedTarget and several helper classes. | |
| file | vlFile.h |
| provides several useful global functions which wrap system file operations in a platform independent way. | |
| file | vlFilename.h |
| This file contains the declaration of DtFilename. | |
| file | vlHashKeys.h |
| This file declares DtBaseHashKey. | |
| file | vlHashlist.h |
| Defines DtHashlist and several helper functions. | |
| file | vlInet.h |
| This file declares useful defaults constants and static methods employed with the networking abstraction layer. | |
| file | vlInetAddr.h |
| This file contains the declaration of the DtInetAddr class. | |
| file | vlInetAddrUtils.h |
| This file declares useful defaults constants and static methods for IP address handling. | |
| file | vlInetDevice.h |
| This file contains the declaration of the DtInetDevice class. | |
| file | vlInetEndpoint.h |
| This file contains the declaration of the DtInetEndpoint class. | |
| file | vlFileTransport.h |
| This class Declares DtFileTransporter and several helper classes. | |
| file | vlInetInterfaceUtils.h |
| This file declares useful defaults constants and static methods for accessing the host network interface adapters. | |
| file | vlInetPlatformUtils.h |
| This file contains the declaration of miscellaneous platform- specific functions. | |
| file | vlInetSocket.h |
| This file contains the declaration of the DtInetSocket base class. | |
| file | vlInetSocketMgr.h |
| This file contains the declaration of the DtInetSocketMgr class. | |
| file | vlInetSocketUtils.h |
| This file contains miscellaneous definitions and inline functions which can be used to extend the functionality of DtInetSocket classes. | |
| file | vlInetTcpSocket.h |
| This file contains the declaration of the DtInetTcpSocket base class. | |
| file | vlInetUdpSocket.h |
| This file contains the declaration of the DtInetUdpSocket base class. | |
| file | vlKeyboard.h |
| This file contains declarations of classes and functions which aid in keyboard input. | |
| file | vlList.h |
| This file contains the declaration of DtList and DtListItem. | |
| file | vlMachineTypes.h |
| This file contains typedefs for machine dependant types. | |
| file | vlMemUtil.h |
| This file contains functions that give information concerning the memory usage of the system. | |
| file | vlMutex.h |
| This file contains the declaration of DtMutex. | |
| file | vlNetTimeStamp.h |
| This file contains the declaration of DtNetTimeStamp. | |
| file | vlNetTypes.h |
| file | vlObservee.h |
| This file contains the declaration of DtObservee. | |
| file | vlObserver.h |
| This file contains the declaration of DtObserver. | |
| file | vlPerformanceStats.h |
| Contains DtTimedSection, DtTimeStatistic, and DtPerformanceStats classes. | |
| file | vlPrint.h |
| Functions in vlPrint.h provide an error and print facility for vrlink. | |
| file | vlPrintUtil.h |
| Utility functions for printing objects. | |
| file | vlProcessControl.h |
| ProcControl.h provides operating system independent methods to control processes. | |
| file | vlRunnable.h |
| Contains declaration of DtRunnable abstract class. | |
| file | vlScopedLock.h |
| Contains DtScopedLock definition. | |
| file | vlSelectParamW.h |
| This file contains the declaration f DtSelectParamWithWrite. | |
| file | vlShmPool.h |
| Contains classes which manage and view a shared memory pool in a platform independent way. | |
| file | vlShmQueue.h |
| This file contains the declaration of DtShmMsgQueueManager. | |
| file | vlShmReader.h |
| This file contains the declaration of DtShmMesgQueueReader. | |
| file | vlShmWriter.h |
| This file contains the declaration of DtShmMsgQueueWriter. | |
| file | vlSmartPointers.h |
| Includes Boost smart pointers and aliases the Boost namespace. | |
| file | vlString.h |
| This file contains the declaration of DtString. | |
| file | vlStringUtil.h |
| This file declares functions and types helpful to developers using DtString. | |
| file | vlThread.h |
| This file contains the declaration of DtThreadStart and DtThread classes. | |
| file | vlThreadedObject.h |
| Defines a ThreadedObject which can run a DtRunnable object in a thread. | |
| file | vlThreadSafe.h |
| Defines a thread-safe template class for variables. | |
| file | vlThreadSysWrapper.h |
| This file contains wrappers for system thread calls. | |
| file | vlTime.h |
| This file contains the declaration of DtClock and DtTime. | |
| file | vlTimeStampType.h |
| file | vlUtil.h |
| provides basic Operating Independent Methods useful to a federate | |
| file | vlUtil.h |
| provides basic Operating Independent Methods useful to a federate | |
| file | vlUtilTypes.h |
| file | vlVersion.h |
| This file declares macros which specify the VR-Link version. | |
Macros | |
| #define | DtDECLARE_OBSERVER_NOTIFIER(ClassName) |
| Creates a notifier used for notifying a <ClassName> object which is observing a DtObservee. | |
| #define | DtDEFINE_OBSERVER_NOTIFIER(ClassName) |
| Defines a notifier used for notifying a <ClassName> object which is observing a DtObservee. | |
| #define | __DtFUNC__ "-Unknown Function-" |
| Note: FUNCTION macro is not defined in Microsoft VC++ 6.0. | |
| #define | DtTHROW_NEW(exceptionClass, errorMsg) throw exceptionClass(DtString(#exceptionClass": ") + errorMsg, __DtFUNC__, DtFilename::stripPath(__FILE__), __LINE__, 0) |
| Throws a new DtException using the class name and the error message. | |
| #define | DtCATCH_AND_PROPAGATE(exceptionClass) |
| catches all exceptions and re-throws DtExceptions with trace. | |
| #define | DtCATCH_AND_WARN(stream) |
| Catches all exceptions and does not re-throw. | |
| #define | DtPROPAGATE(functionBody) |
| Propagate a DtCorruptState exception for a function Usage: functionDeclaration DtPropogate( functionDefinition) functionDefinition must be bound by curly-brackets { } Example: void foo(int bar) DtPropogate( { ... | |
| #define | DtDELETE(x) |
| DT_FD_ZERO_USES_MEMSET. | |
Typedefs | |
| typedef DtTemplatedException < DtInvalidInputNumber > | DtInvalidInput |
| typedef DtTemplatedException < DtUnknownExceptionNumber > | DtUnknownException |
| typedef DtTemplatedException < DtCorruptedStateNumber > | DtCorruptedState |
| typedef DtU8 | DtNetU8 |
| Unsigned 8-bit value. | |
| typedef DtInt8 | DtNetInt8 |
| Signed 8-bit value. | |
| typedef DtNetU8 | DtNetBoolean |
| Unsigned network-order 8-bit value for storage of boolean data. | |
| typedef DtNetU8 | DtNet8Bits |
| Unsigned network-order 8-bit value. | |
| typedef void(* | DtAbortFunc )() |
| typedef DtU32 | DtIpv4Addr |
Enumerations | |
| enum | DtPduTestOperator { DtPduTest_EQ, DtPduTest_NEQ } |
| enum | DtPduFilterType { DtPduFtInetAddr, DtPduFtNetU8 } |
| enum | DtInetIpv6Scope { DtInetIpv6_Unspecified, DtInetIpv6_Interface = 1, DtInetIpv6_LinkLocal = 2, DtInetIpv6_Subnet = 3, DtInetIpv6_AdminLocal = 4, DtInetIpv6_SiteLocal = 5, DtInetIpv6_OrgLocal = 8, DtInetIpv6_Global = 14 } |
| enum | DtNetworkByteOrderType { DtLittleEndian = 0, DtBigEndian = 1 } |
| A simple enumeration to store network byte ordering. More... | |
Functions | |
| bool | DtMakeDirectory (const DtFilename &fp) |
| An Operating System Independent Function which creates the specified directory. | |
| bool | DtDeleteDirectory (const DtFilename &fp) |
| An Operating System Independent Function which deletes the specified directory. | |
| DtFilename | DtGetUserHomeDirectory () |
| Get the path to the users home directory. | |
| DtFilename | DtGetMakUserConfigurationDirectory () |
| Get the path to the MAK users configuration directory. | |
| DtFilename | DtGetTempDirectory () |
| Get the path to the directory in which temporary files should be stored. | |
| std::ostream & | operator<< (std::ostream &, const DtException &) |
| Output operator for Exceptions. | |
| FILE * | DtFileOpen (const char *name, const char *mode) |
| Implementation of a wrapper for the system function "fopen". | |
| void | DtFileClose (FILE *fp) |
| Closes a file opened by DtFileOpen. | |
| int | DtGetCh () |
| Cross-platform version of getCh which returns a single character from input without echoing. | |
| int | DtKbHit () |
| Returns a non-zero is a key was hit. | |
| void | DtRestoreKbHit () |
| On some systems KbHit modifies the terminal settings. | |
| char * | DtPollBlockingInputLine (void) |
| Polls line-buffered standard input. | |
| void | DtPollBlockingInputLine (char *buff, int size) |
| char | DtPollBlockingInputChar (void) |
| Polls standard input for a single character. | |
| char * | DtPollInputLine (void) |
| For Backwards compatibility only. | |
| void | DtPollInputLine (char *buff, int size) |
| For Backwards compatibility only. | |
| char | DtPollInputChar (void) |
| For Backwards compatibility only. | |
| DtNetworkByteOrderType | DtNetworkByteOrdering () |
| Returns the network byte ordering type used by the DtNetType classes. | |
| void | DtSetNetworkByteOrdering (DtNetworkByteOrderType bigOrLittle) |
| Users can set the network byte ordering type used by the DtNetyptes classes. | |
| DtDECLARE_OBSERVER_NOTIFIER (DtObserver) class DtObserver | |
| Instances of DtObserver are used to manage interest in other objects by this object. | |
| void | DtSetVrLinkPrinter (DtPrinter *newPrinter) |
| DtSetVrLinkPrinter is provided for backwards compatibility. | |
| void | DtAbort () |
| DtAbort() exits the program. | |
| void | DtSetAbortFunc (DtAbortFunc func) |
| DtAbortFunc | DtGetAbortFunc () |
| void | DtPrintAndIndent (std::ostream &stream, const DtString &string, int padTo=20) |
| prints the string to the stream, then it adds spaces to fill to padTo. | |
| template<typename T > | |
| void | DtPrintAttribute (std::ostream &stream, const char *label, T obj) |
| Prints out a value of type T with a label. | |
| void | DtPrintAttribute (std::ostream &stream, const char *label, bool obj) |
| An overload of DtPrintAttribute for attributes of type bool. | |
| void | DtPrintAttribute (std::ostream &stream, const char *label, DtU8 obj) |
| An overload of DtPrintAttribute for attributes of type DtU8. | |
| void | DtPrintAttribute (std::ostream &stream, const char *label, const char *enumStr, int enumNum) |
| An overload of DtPrintAttribute which also adds a spot for enumerations. | |
| void | DtDumpHexBytes (const char *label, const void *bytes, int size) |
| These functions DtDumpHexBytes and DtDumpHexWord print hex output to the DtInfo stream. | |
| void | DtPrintAttributeHex (std::ostream &stream, const char *label, const void *bytes, int size) |
| void | DtDumpLineOfHex (std::ostream &stream, DtU8 *address, size_t num_bytes) |
| Prints to stream one line (with a newline at the end) of hex data grouped by bytes. | |
| void | DtDumpHex (std::ostream &str, const char *address, size_t num_bytes) |
| Prints to stream a byte buffer, neatly seperating bytes and putting only 4 bytes on a line. | |
| void | DtPrintAttributeHex (std::ostream &stream, const char *label, DtU32 word) |
| Prints a DtU32 value to the provided stream. | |
| void | DtDumpHexWord (const char *label, DtU32 word) |
| Prints a DtU32 word to DtInfo. | |
| void | DtDumpEnum (const char *label, const char *enumStr, int enumNum) |
| DtDumpEnum prints a label, a enumeration string, and an enumeration value. | |
| void | DtDumpInteger (const char *label, long i) |
| formats and prints an integer next to a label using the DtInfo Stream. | |
| void | DtDumpFloat (const char *label, double f) |
| formats and prints a floating point value next to a label using the DtInfo Stream. | |
| void | DtDumpString (const char *label, const char *string) |
| formats and prints a string next to a label using the DtInfo Stream. | |
| void | DtDumpString (const char *label, const DtString &string) |
| formats and prints a string next to a label using the DtInfo Stream. | |
| void | DtDumpBoolean (const char *label, bool val, int onlyIfTrue=0) |
| formats and prints a boolean value next to a label using the DtInfo Stream. | |
| void | DtYield () |
| Yields the thread. | |
| void | DtSleep (DtTime sleep_period) |
| Puts the process to sleep for the specified number of seconds. | |
| bool | DtCreateProcess (const DtFilename &executableName, const std::vector< char * > &args, DtProcessInteractivityMode interactive=DtProcFgInteractive) |
| Creates a new process by running executableName with the specified commandLine. | |
| int | DtROUND_TO_MULT (int num, int mult) |
| Rounds num up to a multiple of mult. | |
| template<typename T > | |
| T | DtMax (T x, T y) |
| Returns what ever is greater, x or y of type T. | |
| template<typename T > | |
| T | DtMin (T x, T y) |
| Returns the which ever is lesser, x or y of type T. | |
| char * | DtDeg2DmsString (double val, char *buff, int prec) |
| char * | DtDeg2DmsString (double val) |
| int | DtIsInList (const int *lst, int num) |
| Returns -1 if num is not in lst. | |
| int | DtSelect (int n, fd_set *i, fd_set *o, fd_set *e, DtTime t) |
| void | DtClose (int &fd) |
| char * | DtStrdup (const char *str) |
| Strdup wrapper. | |
| char * | DtToLower (char *str) |
| Convert str to all lowercase. | |
| char * | DtToUpper (char *str) |
| Convert str to all uppercase. | |
| const char * | DtInetAddrString (DtIpv4Addr addr) |
| Converts ulong to internet dot notation (returns internal static buffer). | |
| DtIpv4Addr | DtStringToInetAddr (const char *str) |
| Converts to internet dot notation to ulong in host order. | |
| DtIpv4Addr | DtStringToInetAddr (const DtString &str) |
| DtIpv4Addr | DtHexStringToInetAddr (const char *str) |
| Converts to internet dot notation to ulong in host order. | |
| int | DtArgc (char *cmdLine) |
| Convert a command line (single string with args separated by spaces) to argv, argc format. | |
| const char * | DtOperatingSystem () |
| Returns the platform we're running on. | |
| const char * | DtCompiler () |
| Returns the compiler. | |
| int | DtGetPid () |
| Returns the process ID for the running process. | |
| int | DtGetPPid () |
| Returns the process ID for the parent of the running process. | |
Variables | |
| const int | DtInvalidInputNumber = ~0 |
| Thrown when an input parameter to a function or a CTOR was invalid. | |
| const int | DtUnknownExceptionNumber = ~1 |
| Thrown when an unknown exception was caught. | |
| const int | DtCorruptedStateNumber = ~2 |
| Thrown when an object's state is somehow corrupted. | |
| DtStdoutPrinter | DtStandardOutConsole |
| This class is a basic DtPrinter instance which can be used with DtOutputStream instances. | |
| DtStderrPrinter | DtStandardErrorConsole |
| This class is a basic DtPrinter instance which can be used with DtOutputStream instances. | |
| const DtIpv4Addr | DtInetAddrAny = 0 |
| const DtIpv4Addr | loopbackAddr = 0x7f000001 |
DtInetSocket Types | |
Define the types used by DtInetSocket class Buffer sequence compatible with Boost ConstBufferSequence and MutableBufferSequence for scatter / gather operations. | |
| enum | DtInetSockState { DtInetSockState_ERROR = -1, DtInetSockState_NOT_INITIALIZED = 0, DtInetSockState_INITIALIZED, DtInetSockState_OPEN, DtInetSockState_LISTENING, DtInetSockState_INPROGRESS, DtInetSockState_CONN_REFUSED, DtInetSockState_CONNECTED, DtInetSockState_TIMEDOUT, DtInetSockState_DISCONNECTED, DtInetSockState_CLOSED } |
| Socket state enumeration. More... | |
| enum | DtInetSockRcvStatus { DtInetSockRcv_UNBUNDLED_PACKET = -5, DtInetSockRcv_BUFFER_TOO_SMALL = -4, DtInetSockRcv_FILTERED_BY_PORT = -3, DtInetSockRcv_FILTERED_PACKET = -2, DtInetSockRcv_ERROR = -1, DtInetSockRcv_NO_PACKET = 0, DtInetSockRcv_MAX_RETVAL = INT_MAX } |
| Socket state enumeration. More... | |
| enum | DtInetSockFlushStatus { DtInetSockFlush_ERROR = -1, DtInetSockFlush_MORE_TO_FLUSH = 0, DtInetSockFlush_FLUSH_COMPLETE = 1 } |
| Socket state enumeration. More... | |
| enum | DtInetSockProcessingType { DtInetSockProcess_PRE_RECV, DtInetSockProcess_POST_RECV, DtInetSockProcess_PRE_SEND, DtInetSockProcess_POST_SEND } |
| Socket state enumeration. More... | |
| typedef int(* | DtInetSocketProcessingCallback )(DtInetSocket *sock, int size, DtInetBufferChain &buffChain, DtInetEndpoint &ep, void *usr) |
| Callbacks Pre- / Post- processing callback prototype. | |
| typedef std::vector< char > | DtInetBuffer |
| Socket state enumeration. | |
| typedef std::vector < DtInetBuffer * > | DtInetBufferChain |
| Socket state enumeration. | |
| typedef std::pair< void *, DtInetBuffer * > | DtInetBuffQueueEntry |
| Socket state enumeration. | |
| typedef DtThreadSafe < std::deque < DtInetBuffQueueEntry > > | DtInetThreadSafeQueue |
| Socket state enumeration. | |
| typedef std::multimap< int, DtInetSocketProcessingCbInfo * > | DtInetSockCallbackList |
| Socket state enumeration. | |
| DtOutputStream | DtFatal |
| These DtOutputStream instances are used for all print messaging in VR-Link. | |
| DtOutputStream | DtWarn |
| These DtOutputStream instances are used for all print messaging in VR-Link. | |
| DtOutputStream | DtInfo |
| DtInfo is an global instance of a DtOutputStream. | |
| DtOutputStream | DtVerbose |
| These DtOutputStream instances are used for all print messaging in VR-Link. | |
| DtOutputStream | DtDebug |
| These DtOutputStream instances are used for all print messaging in VR-Link. | |
| void | DtFatalError (const char *str,...) |
| These functions print messages using DtOutputStreams depending on the notify level. | |
| void | DtFatalPerror (const char *str,...) |
| These functions print messages using DtOutputStreams depending on the notify level. | |
| void | DtWarnPerror (const char *str,...) |
| These functions print messages using DtOutputStreams depending on the notify level. | |
| void | DtFatalNetPerror (const char *str,...) |
| These functions print messages using DtOutputStreams depending on the notify level. | |
| void | DtWarnNetPerror (const char *str,...) |
| These functions print messages using DtOutputStreams depending on the notify level. | |
The vlutil library contains classes and functions which provide an operating system independent interface to commonly used operating system dependant functionality.
The vlutil library also contains classes and functions which implement commonly used data structures used by MAK Products.
| #define __DtFUNC__ "-Unknown Function-" |
Note: FUNCTION macro is not defined in Microsoft VC++ 6.0.
| #define DtCATCH_AND_PROPAGATE | ( | exceptionClass | ) |
catches all exceptions and re-throws DtExceptions with trace.
| #define DtCATCH_AND_WARN | ( | stream | ) |
Catches all exceptions and does not re-throw.
Will issue an error to the stream passed in.
| #define DtDECLARE_OBSERVER_NOTIFIER | ( | ClassName | ) |
Creates a notifier used for notifying a <ClassName> object which is observing a DtObservee.
Class <ClassName> must have a public function of the form: virtual bool notifyFromYourObserved(DtObservee* observed, const DtObservee::DtWhyNotifyObserver& why);
DtDECLARE_OBSERVER_NOTIFIER and DtDEFINE_OBSERVER_NOTIFIER can be used to create a derived notifier class which knows how to communicate with the observer class. For example, this is done in class DtObserver to create a class which can observe DtObservee objects.
| #define DtDEFINE_OBSERVER_NOTIFIER | ( | ClassName | ) |
Defines a notifier used for notifying a <ClassName> object which is observing a DtObservee.
| #define DtDELETE | ( | x | ) |
DT_FD_ZERO_USES_MEMSET.
Referenced by DtInetSocket::findAndRemoveCallback().
| #define DtPROPAGATE | ( | functionBody | ) |
Propagate a DtCorruptState exception for a function Usage: functionDeclaration DtPropogate( functionDefinition) functionDefinition must be bound by curly-brackets { } Example: void foo(int bar) DtPropogate( { ...
do something that might throw an exception } )
| #define DtTHROW_NEW | ( | exceptionClass, | |
| errorMsg | |||
| ) | throw exceptionClass(DtString(#exceptionClass": ") + errorMsg, __DtFUNC__, DtFilename::stripPath(__FILE__), __LINE__, 0) |
Throws a new DtException using the class name and the error message.
| typedef void(* DtAbortFunc)() |
| typedef std::vector<char> DtInetBuffer |
Socket state enumeration.
| typedef std::vector<DtInetBuffer*> DtInetBufferChain |
Socket state enumeration.
| typedef std::pair<void*, DtInetBuffer*> DtInetBuffQueueEntry |
Socket state enumeration.
| typedef std::multimap<int, DtInetSocketProcessingCbInfo*> DtInetSockCallbackList |
Socket state enumeration.
| typedef int(* DtInetSocketProcessingCallback)(DtInetSocket *sock, int size, DtInetBufferChain &buffChain, DtInetEndpoint &ep, void *usr) |
Callbacks Pre- / Post- processing callback prototype.
'sock' will be set to the socket object invoking the callback. 'size' will be set to either 0 for pre-send and pre-receive callbacks OR to the actual number of bytes sent or received by the send or receive operation preceding post-processing callbacks. Callbacks must return the number of bytes in buffChain after processing is complete or a value less than 0 (ie. -1 for send or a DtInetSockRcvStatus value for receive) if a processing error occurs. Callbacks are only invoked by a socket's sendChain(), sendChainTo(), recvToChain() or recvToChainFrom() methods.
| typedef DtThreadSafe<std::deque<DtInetBuffQueueEntry> > DtInetThreadSafeQueue |
Socket state enumeration.
| typedef DtU32 DtIpv4Addr |
| typedef DtNetU8 DtNet8Bits |
Unsigned network-order 8-bit value.
| typedef DtNetU8 DtNetBoolean |
Unsigned network-order 8-bit value for storage of boolean data.
| enum DtInetIpv6Scope |
| enum DtInetSockRcvStatus |
| enum DtInetSockState |
Socket state enumeration.
| enum DtPduFilterType |
| enum DtPduTestOperator |
| void DtAbort | ( | ) |
DtAbort() exits the program.
The user can provide for different behaviour [e.g. calling abort()] by passing a new abort function to DtSetAbortFunc
| int DtArgc | ( | char * | cmdLine | ) |
Convert a command line (single string with args separated by spaces) to argv, argc format.
|
inline |
| const char* DtCompiler | ( | ) |
Returns the compiler.
| bool DtCreateProcess | ( | const DtFilename & | executableName, |
| const std::vector< char * > & | args, | ||
| DtProcessInteractivityMode | interactive = DtProcFgInteractive |
||
| ) |
Creates a new process by running executableName with the specified commandLine.
| DtDECLARE_OBSERVER_NOTIFIER | ( | DtObserver | ) |
Instances of DtObserver are used to manage interest in other objects by this object.
This class works in conjunction with DtObservee, since without its cooperation, this observer cannot know when the watched object goes away.
Uses DtDECLARE_OBSERVER_NOTIFIER and DtDEFINE_OBSERVER_NOTIFIER to create a derived notifier class which knows how to communicate with this observer class which can observe DtObservee objects. A single instance of DtObserver can watch multiple instances of the DtObservee class.
| char* DtDeg2DmsString | ( | double | val, |
| char * | buff, | ||
| int | prec | ||
| ) |
| char* DtDeg2DmsString | ( | double | val | ) |
| bool DtDeleteDirectory | ( | const DtFilename & | fp | ) |
An Operating System Independent Function which deletes the specified directory.
returns: true - if directory is deleted false - if there was an error
| void DtDumpBoolean | ( | const char * | label, |
| bool | val, | ||
| int | onlyIfTrue = 0 |
||
| ) |
formats and prints a boolean value next to a label using the DtInfo Stream.
| void DtDumpEnum | ( | const char * | label, |
| const char * | enumStr, | ||
| int | enumNum | ||
| ) |
DtDumpEnum prints a label, a enumeration string, and an enumeration value.
You need to use another function to compute the enumStr. This function has been replaced by DtPrintAttriubte overloads generated in libVL in the parseEnum.h header.
| void DtDumpFloat | ( | const char * | label, |
| double | f | ||
| ) |
formats and prints a floating point value next to a label using the DtInfo Stream.
| void DtDumpHex | ( | std::ostream & | str, |
| const char * | address, | ||
| size_t | num_bytes | ||
| ) |
Prints to stream a byte buffer, neatly seperating bytes and putting only 4 bytes on a line.
| void DtDumpHexBytes | ( | const char * | label, |
| const void * | bytes, | ||
| int | size | ||
| ) |
These functions DtDumpHexBytes and DtDumpHexWord print hex output to the DtInfo stream.
| void DtDumpHexWord | ( | const char * | label, |
| DtU32 | word | ||
| ) |
Prints a DtU32 word to DtInfo.
| void DtDumpInteger | ( | const char * | label, |
| long | i | ||
| ) |
formats and prints an integer next to a label using the DtInfo Stream.
| void DtDumpLineOfHex | ( | std::ostream & | stream, |
| DtU8 * | address, | ||
| size_t | num_bytes | ||
| ) |
Prints to stream one line (with a newline at the end) of hex data grouped by bytes.
| void DtDumpString | ( | const char * | label, |
| const char * | string | ||
| ) |
formats and prints a string next to a label using the DtInfo Stream.
| void DtDumpString | ( | const char * | label, |
| const DtString & | string | ||
| ) |
formats and prints a string next to a label using the DtInfo Stream.
| void DtFatalError | ( | const char * | str, |
| ... | |||
| ) |
These functions print messages using DtOutputStreams depending on the notify level.
Each method uses the matching DtOutputStream for all messages. Fatal funcs call DtAbort at end, even if (notifyLevel < DtNlFatal) Fatal prints are preceded by "**FATAL ERROR**: " the DtFatalError print is followed by
Perror prints are followed by a call to perror()
| void DtFatalNetPerror | ( | const char * | str, |
| ... | |||
| ) |
These functions print messages using DtOutputStreams depending on the notify level.
Each method uses the matching DtOutputStream for all messages. Fatal funcs call DtAbort at end, even if (notifyLevel < DtNlFatal) Fatal prints are preceded by "**FATAL ERROR**: " the DtFatalError print is followed by
Perror prints are followed by a call to perror()
| void DtFatalPerror | ( | const char * | str, |
| ... | |||
| ) |
These functions print messages using DtOutputStreams depending on the notify level.
Each method uses the matching DtOutputStream for all messages. Fatal funcs call DtAbort at end, even if (notifyLevel < DtNlFatal) Fatal prints are preceded by "**FATAL ERROR**: " the DtFatalError print is followed by
Perror prints are followed by a call to perror()
| void DtFileClose | ( | FILE * | fp | ) |
Closes a file opened by DtFileOpen.
| FILE* DtFileOpen | ( | const char * | name, |
| const char * | mode | ||
| ) |
Implementation of a wrapper for the system function "fopen".
This is necessitated by the apparent problem with opening a file stream in an application built with the Microsoft .Net compiler and passing a file pointer to it to a .dll built with the Microsoft C++ 6.0 compiler.
| DtAbortFunc DtGetAbortFunc | ( | ) |
| int DtGetCh | ( | ) |
Cross-platform version of getCh which returns a single character from input without echoing.
This function is blocking. If a multi-character key is pressed (for example the arrow keys) this function must be called twice to read both characters.
| DtFilename DtGetMakUserConfigurationDirectory | ( | ) |
Get the path to the MAK users configuration directory.
On UNIX this is $HOME/.mak, on Windows this is usually the {RoamingAppData folder}
| int DtGetPid | ( | ) |
Returns the process ID for the running process.
| int DtGetPPid | ( | ) |
Returns the process ID for the parent of the running process.
| DtFilename DtGetTempDirectory | ( | ) |
Get the path to the directory in which temporary files should be stored.
On UNIX this is /tmp, on Windows this is the directory returned by GetTempPath().
| DtFilename DtGetUserHomeDirectory | ( | ) |
Get the path to the users home directory.
On UNIX this is reported in the password file. On Windows this is usually the {User Profile} folder but is dependent on the version of Windows you are using.
| DtIpv4Addr DtHexStringToInetAddr | ( | const char * | str | ) |
Converts to internet dot notation to ulong in host order.
| const char* DtInetAddrString | ( | DtIpv4Addr | addr | ) |
Converts ulong to internet dot notation (returns internal static buffer).
| int DtIsInList | ( | const int * | lst, |
| int | num | ||
| ) |
Returns -1 if num is not in lst.
Otherwise, returns the index in the list at which num is first found. lst must be a zero-terminated array of integers.
| int DtKbHit | ( | ) |
Returns a non-zero is a key was hit.
This function is non-blocking on some terminals will reset keyboard input. Failure to call DtRestoreKbHit() will cause the users console to not echo key presses.
| 0 | No key was pressed |
| !=0 | A key was pressed. the return value is NOT the value of the key pressed. |
| bool DtMakeDirectory | ( | const DtFilename & | fp | ) |
An Operating System Independent Function which creates the specified directory.
returns: true - if directory is created false - if there was an error
| T DtMax | ( | T | x, |
| T | y | ||
| ) |
Returns what ever is greater, x or y of type T.
Referenced by DtSelectParamWithWrite::addRead(), DtSelectParam::addRead(), and DtSelectParamWithWrite::addWrite().
| T DtMin | ( | T | x, |
| T | y | ||
| ) |
Returns the which ever is lesser, x or y of type T.
| DtNetworkByteOrderType DtNetworkByteOrdering | ( | ) |
Returns the network byte ordering type used by the DtNetType classes.
| const char* DtOperatingSystem | ( | ) |
Returns the platform we're running on.
| char DtPollBlockingInputChar | ( | void | ) |
Polls standard input for a single character.
Returns '\0' if there is no input. Returns next unread character if there is input. Exits on ^D.
Referenced by DtPollInputChar(), DtCmdLine::CmdLine::parse(), DtCmdLine::HelpVisitor::visit(), and DtCmdLine::VersionVisitor::visit().
| char* DtPollBlockingInputLine | ( | void | ) |
Polls line-buffered standard input.
Poll functions are non-blocking until input is entered, they then block until enter is pressed.
| NULL | if no input is input, this is returned immediately Returns internal buffer of line if have input. Exits on ^D. |
Referenced by DtPollInputLine().
| void DtPollBlockingInputLine | ( | char * | buff, |
| int | size | ||
| ) |
|
inline |
For Backwards compatibility only.
References DtPollBlockingInputChar().
|
inline |
For Backwards compatibility only.
References DtPollBlockingInputLine().
|
inline |
For Backwards compatibility only.
References DtPollBlockingInputLine().
| void DtPrintAndIndent | ( | std::ostream & | stream, |
| const DtString & | string, | ||
| int | padTo = 20 |
||
| ) |
prints the string to the stream, then it adds spaces to fill to padTo.
The minimum number of characters printed will be padTo. This functionw will not truncate the string, but will pad only inf the string is shorter than padTo.
Referenced by DtPrintAttribute().
| void DtPrintAttribute | ( | std::ostream & | stream, |
| const char * | label, | ||
| T | obj | ||
| ) |
Prints out a value of type T with a label.
The value will be printed at a location 20 characters from the start of the label.
References DtPrintAndIndent().
| void DtPrintAttribute | ( | std::ostream & | stream, |
| const char * | label, | ||
| bool | obj | ||
| ) |
An overload of DtPrintAttribute for attributes of type bool.
| void DtPrintAttribute | ( | std::ostream & | stream, |
| const char * | label, | ||
| DtU8 | obj | ||
| ) |
An overload of DtPrintAttribute for attributes of type DtU8.
| void DtPrintAttribute | ( | std::ostream & | stream, |
| const char * | label, | ||
| const char * | enumStr, | ||
| int | enumNum | ||
| ) |
An overload of DtPrintAttribute which also adds a spot for enumerations.
| void DtPrintAttributeHex | ( | std::ostream & | stream, |
| const char * | label, | ||
| const void * | bytes, | ||
| int | size | ||
| ) |
| void DtPrintAttributeHex | ( | std::ostream & | stream, |
| const char * | label, | ||
| DtU32 | word | ||
| ) |
Prints a DtU32 value to the provided stream.
| void DtRestoreKbHit | ( | ) |
On some systems KbHit modifies the terminal settings.
Calls to DtRestoreKbHit will reset some of the settings. For performance reasons it is not optimal to call restore frequently. Usually on exit is sufficient.
|
inline |
Rounds num up to a multiple of mult.
| int DtSelect | ( | int | n, |
| fd_set * | i, | ||
| fd_set * | o, | ||
| fd_set * | e, | ||
| DtTime | t | ||
| ) |
Referenced by DtSelectParamWithWrite::select(), and DtSelectParam::select().
| void DtSetAbortFunc | ( | DtAbortFunc | func | ) |
| void DtSetNetworkByteOrdering | ( | DtNetworkByteOrderType | bigOrLittle | ) |
Users can set the network byte ordering type used by the DtNetyptes classes.
The default network byte ordering is BigEndian.
| void DtSetVrLinkPrinter | ( | DtPrinter * | newPrinter | ) |
DtSetVrLinkPrinter is provided for backwards compatibility.
Setting this will remove all printers from DtFatal, DtWarn, DtInfo DtVerbose and DtDebug, and then install the new printer on each of them.
| void DtSleep | ( | DtTime | sleep_period | ) |
Puts the process to sleep for the specified number of seconds.
This function does not yield if the sleep period is 0. To yield a thread you need to call DtYield
Referenced by DtCmdLine::CmdLine::parse(), DtCmdLine::HelpVisitor::visit(), and DtCmdLine::VersionVisitor::visit().
| char* DtStrdup | ( | const char * | str | ) |
Strdup wrapper.
Returns NULL if str is NULL. Otherwise returns a newed char* containing a copy of str. Caller deletes using delete[].
| DtIpv4Addr DtStringToInetAddr | ( | const char * | str | ) |
Converts to internet dot notation to ulong in host order.
| DtIpv4Addr DtStringToInetAddr | ( | const DtString & | str | ) |
| char* DtToLower | ( | char * | str | ) |
Convert str to all lowercase.
| char* DtToUpper | ( | char * | str | ) |
Convert str to all uppercase.
| void DtWarnNetPerror | ( | const char * | str, |
| ... | |||
| ) |
These functions print messages using DtOutputStreams depending on the notify level.
Each method uses the matching DtOutputStream for all messages. Fatal funcs call DtAbort at end, even if (notifyLevel < DtNlFatal) Fatal prints are preceded by "**FATAL ERROR**: " the DtFatalError print is followed by
Perror prints are followed by a call to perror()
| void DtWarnPerror | ( | const char * | str, |
| ... | |||
| ) |
These functions print messages using DtOutputStreams depending on the notify level.
Each method uses the matching DtOutputStream for all messages. Fatal funcs call DtAbort at end, even if (notifyLevel < DtNlFatal) Fatal prints are preceded by "**FATAL ERROR**: " the DtFatalError print is followed by
Perror prints are followed by a call to perror()
| void DtYield | ( | ) |
Yields the thread.
On windows this is the same as calling Sleep(0), and on unix this calls sched_yield();
| std::ostream& operator<< | ( | std::ostream & | , |
| const DtException & | |||
| ) |
Output operator for Exceptions.
| const int DtCorruptedStateNumber = ~2 |
Thrown when an object's state is somehow corrupted.
| DtOutputStream DtDebug |
These DtOutputStream instances are used for all print messaging in VR-Link.
They are also used by the Dt<>Error functions below. Each instance uses a matching DtNotifyLevel as its threshold by default. The DtFatal DtOutputStream does not call abort, and is only useful when called through DtFatalError.
| DtOutputStream DtFatal |
These DtOutputStream instances are used for all print messaging in VR-Link.
They are also used by the Dt<>Error functions below. Each instance uses a matching DtNotifyLevel as its threshold by default. The DtFatal DtOutputStream does not call abort, and is only useful when called through DtFatalError.
| const DtIpv4Addr DtInetAddrAny = 0 |
| DtOutputStream DtInfo |
DtInfo is an global instance of a DtOutputStream.
It is used to print diagnostic information for all MAK federates. All DtOutputStreams may be connected to a DtPrinter class which may either print to a file, a console, or a GUI window. Each DtOutputStream will only print to their respective printer if a
Referenced by DtCmdLine::CmdLine::parse(), DtCmdLine::StdOutput::usage(), DtCmdLine::StdOutput::version(), DtCmdLine::HelpVisitor::visit(), and DtCmdLine::VersionVisitor::visit().
| const int DtInvalidInputNumber = ~0 |
Thrown when an input parameter to a function or a CTOR was invalid.
| DtStderrPrinter DtStandardErrorConsole |
| DtStdoutPrinter DtStandardOutConsole |
| const int DtUnknownExceptionNumber = ~1 |
Thrown when an unknown exception was caught.
| DtOutputStream DtVerbose |
These DtOutputStream instances are used for all print messaging in VR-Link.
They are also used by the Dt<>Error functions below. Each instance uses a matching DtNotifyLevel as its threshold by default. The DtFatal DtOutputStream does not call abort, and is only useful when called through DtFatalError.
| DtOutputStream DtWarn |
These DtOutputStream instances are used for all print messaging in VR-Link.
They are also used by the Dt<>Error functions below. Each instance uses a matching DtNotifyLevel as its threshold by default. The DtFatal DtOutputStream does not call abort, and is only useful when called through DtFatalError.
Referenced by DtCmdLine::StdOutput::failure().
| const DtIpv4Addr loopbackAddr = 0x7f000001 |