VR Juggler Portable Runtime

Programmer's Guide

Verrsion 2.0

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being Appendix B, GNU Free Documentation License, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in Appendix B, GNU Free Documentation License.

$Date: 2007-06-29 17:38:02 -0500 (Fri, 29 Jun 2007) $


Table of Contents

Vaporous Programming
I. Input/Output
1. Buffered I/O
Opening and Closing
Setting Attributes for Opening
Blocking Versus Non-Blocking
Reading and Writing
Statistics Collection
2. Sockets
Internet Addresses
Socket Commonalities
Uses of vpr::Socket
Fixed Blocking State
Datagram-Oriented Sockets
Stream-Oriented Sockets
The Acceptor/Connector Pattern
The Acceptor
The Connector
3. Serial Ports
Interface Overview
Abstraction Details
4. Data Marshaling
Endian Conversion
Object Serialization
II. Multi-Threading
5. Creating Threads
Threads: Using vpr::Thread
Creating Threads
Waiting for a Thread to Complete
Suspending and Resuming a Thread's Execution
Getting and Setting a Thread's Priority
Sending Signals to a Thread
Canceling a Thread's Execution
Requesting the Current Thread's Identifier
The Gory Details
Thread Functors
High-Level Description
Functors from (Non-Static) Member Functions
Functors from Static Member Functions
Functors from Non-Member Functions
Functors from Callable Objects
Updating from VPR 1.0
6. Synchronization
Semaphores: Using vpr::Semaphore
High-Level Description
Creating a Semaphore
Locking a Semaphore
Releasing a Locked Semaphore
The Gory Details
Mutual Exclusion: Using vpr::Mutex
High-Level Description
Creating a Mutex
Locking a Mutex
Attempting to Lock a Mutex
Testing the State of a Mutex
Releasing a Locked Mutex
The Gory Details
Condition Variables: Using vpr::CondVar
High-Level Description
Creating a Condition Variable
Locking a Condition Variable
Attempting to Lock a Condition Variable
Releasing a Locked Condition Variable
Putting Condition Variables to Use
7. Signal Handling
III. Miscellaneous Utilities
8. Simulated Sockets
Sim Socket Interface
Sim Socket Implementation
9. Globally Unique Identifiers
GUID Creation
GUID Operations
10. Intervals
Interval Creation
Interval Operations
11. Singletons
12. Factories
13. Performance Monitoring
IV. Appendices
A. I/O Implementation Information
B. GNU Free Documentation License
PREAMBLE
APPLICABILITY AND DEFINITIONS
VERBATIM COPYING
COPYING IN QUANTITY
MODIFICATIONS
COMBINING DOCUMENTS
COLLECTIONS OF DOCUMENTS
AGGREGATION WITH INDEPENDENT WORKS
TRANSLATION
TERMINATION
FUTURE REVISIONS OF THIS LICENSE
ADDENDUM: How to use this License for your documents
Bibliography
Glossary of Terms
Index

List of Examples

5.1. Using Boost.Bind to Create Thread Functors
5.2. Member Function for Thread Functor (1)
5.3. Member Function for Thread Functor (2)
5.4. Member Function for Thread Functor (3)
5.5. Member Function for Thread Functor (4)
5.6. Static Member Function for Thread Functor (1)
5.7. Static Member Function for Thread Functor (2)
5.8. Static Member Function for Thread Functor (3)
5.9. Non-Member Function for Thread Functor
5.10. Callable Object for Thread Functor (1)
5.11. Callable Object for Thread Functor (2)
5.12. Callable Object for Thread Functor (3)
5.13. VPR 1.0 Use of Thread Non-Member Functor
5.14. Updated Use of Static Member Function for Thread Functor
5.15. VPR 1.0 Use of Thread Member Functor
5.16. Updated Use of Member Function for Thread Functor
11.1. Use of vprSingletonHeader()
11.2. Use of vprSingletonImp()
11.3. Use of vprSingletonHeaderWithInitFunc()
11.4. Use of vprSingletonImpWithInitFunc()
11.5. Use of vprSingletonImpLifetime()
11.6. Use of vpr::Singleton<T>