Adding VAStruct char* bracket operator support for direct access with text fields, and style

parent 946545dc
......@@ -116,10 +116,12 @@ public:
CVAStructValue* GetValue(const std::string& sPath, char cPathSeparator=DEFAULT_PATH_SEPARATOR);
//! Read-only data access
const CVAStructValue& operator[](const std::string& sKey) const;
const CVAStructValue& operator[](const char* pcKey) const;
inline const CVAStructValue& operator[](const std::string& sKey) const { return (*this)[sKey.c_str()]; };
//! Read/write data access
CVAStructValue& operator[](const std::string& sKey);
CVAStructValue& operator[](const char* pcKey);
inline CVAStructValue& operator[](const std::string& sKey) { return (*this)[sKey.c_str()]; };
//! Assignment
CVAStruct& operator=(const CVAStruct& rhs);
......@@ -224,11 +226,12 @@ public:
//! Read-only data access
// Note: Is applicable only for struct keys
const CVAStructValue& operator[](const std::string& sKey) const;
const CVAStructValue& operator[](const char* pcKey) const;
//! Read/write data access
// Note: Is applicable only for struct keys
CVAStructValue& operator[](const std::string& sKey);
CVAStructValue& operator[](const char* pcKey);
inline CVAStructValue& operator[](const std::string& sKey) { return (*this)[sKey.c_str()]; };
//! Cast to bool operator (required for assignments of the form 'bool = CVAStructKey')
operator bool() const;
......
/*
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA)
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* File: VABaseDefinitions.cpp
*
* Purspose: Global definitions and declarations
*
* Author(s): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*/
// $Id: $
#include <VABaseDefinitions.h>
#include <iostream>
#include <iomanip>
std::ostream& operator<<(std::ostream& os, const VAVec3& oVec) {
std::ostream& operator<<(std::ostream& os, const VAVec3& oVec)
{
return os << std::fixed << std::setprecision(3)
<< "< " << oVec.x << ", " << oVec.y << ", " << oVec.z << " >";
<< "< " << oVec.x << ", " << oVec.y << ", " << oVec.z << " >";
}
std::ostream& operator<<(std::ostream& os, const VAOrientYPR& oOrient) {
std::ostream& operator<<(std::ostream& os, const VAOrientYPR& oOrient)
{
return os << std::fixed << std::setprecision(2)
<< "< " << oOrient.yaw << ", " << oOrient.pitch << ", " << oOrient.roll << " >";
}
/*
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* Datei: VACoreEvent.cpp
*
* Zweck: Basisklasse fr Kern-Nachrichten
*
* Autor(en): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*/
// $Id: VACoreEvent.cpp 4147 2015-08-03 15:45:06Z fwefers $
#include <VACoreEvent.h>
#include <VACore.h>
......
......@@ -2,7 +2,8 @@
#include <sstream>
std::string CVACoreVersionInfo::ToString() const {
std::string CVACoreVersionInfo::ToString() const
{
// Ausgabeformat: "VACore 1.24 [FLAGS] (COMMENT)"
std::stringstream ss;
ss << "VACore " << sVersion;
......
/*
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* Datei: VAEventHandlerGlobalLock.cpp
*
* Zweck: Global synchronization token for event handler operations
*
* Autor(en): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de
*
* ---------------------------------------------------------------------------------
*/
// $Id: VABaseDefinitions.h 1717 2011-04-04 21:01:04Z fwefers $
#include <VAEventHandlerGlobalLock.h>
// @todo: remove dependency and replace by c++11 std::mutex
#include <VistaInterProcComm/Concurrency/VistaMutex.h>
// Implementation class
class CVAEventHandlerGlobalLockImpl : public IVAEventHandlerGlobalLock {
class CVAEventHandlerGlobalLockImpl : public IVAEventHandlerGlobalLock
{
public:
mutable VistaMutex m_oLock;
void Lock() const { m_oLock.Lock(); }
void Unlock() const { m_oLock.Unlock(); }
inline void Lock() const
{
m_oLock.Lock();
};
inline void Unlock() const
{
m_oLock.Unlock();
};
CVAEventHandlerGlobalLockImpl() {};
~CVAEventHandlerGlobalLockImpl() {};
inline CVAEventHandlerGlobalLockImpl() {};
inline ~CVAEventHandlerGlobalLockImpl() {};
};
// Singleton instance
CVAEventHandlerGlobalLockImpl g_oEventHandlerGlobalLock;
IVAEventHandlerGlobalLock& IVAEventHandlerGlobalLock::GetInstance() {
IVAEventHandlerGlobalLock& IVAEventHandlerGlobalLock::GetInstance()
{
return g_oEventHandlerGlobalLock;
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment