NamedVariantData.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2012-2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DATASTRUCTURES_NAMEDVARIANTDATA_H
#define SURGSIM_DATASTRUCTURES_NAMEDVARIANTDATA_H
#include <boost/any.hpp>
#include "SurgSim/DataStructures/NamedData.h"
#include "SurgSim/DataStructures/NamedDataBuilder.h"
namespace SurgSim
{
namespace DataStructures
{
typedef NamedDataBuilder<boost::any> NamedVariantDataBuilder;
class NamedVariantData : public NamedData<boost::any>
{
public:
NamedVariantData();
NamedVariantData(const NamedData<boost::any>& namedData); //NOLINT
template <typename T>
inline bool hasTypedData(int index) const;
template <typename T>
inline bool hasTypedData(const std::string& name) const;
template <typename T>
inline bool get(int index, T* value) const;
template <typename T>
inline bool get(const std::string& name, T* value) const;
};
}; // namespace DataStructures
}; // namespace SurgSim
#include "SurgSim/DataStructures/NamedVariantData-inl.h"
#endif // SURGSIM_DATASTRUCTURES_NAMEDVARIANTDATA_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::DataStructures::NamedVariantData
A NamedData collection of variant data type.
Definition: NamedVariantData.h:39
SurgSim::DataStructures::NamedVariantData::NamedVariantData
NamedVariantData()
Definition: NamedVariantData-inl.h:26
SurgSim::DataStructures::NamedData
A templated dictionary in which data can be accessed by name or index, with immutable names & indices...
Definition: NamedData.h:102
SurgSim::DataStructures::NamedVariantDataBuilder
NamedDataBuilder< boost::any > NamedVariantDataBuilder
Definition: NamedVariantData.h:28
NamedData.h
SurgSim::DataStructures::NamedDataBuilder< boost::any >
NamedVariantData-inl.h
NamedDataBuilder.h
SurgSim::DataStructures::NamedVariantData::hasTypedData
bool hasTypedData(int index) const
Check whether the entry with the specified index contains valid data.
Definition: NamedVariantData-inl.h:36