-/* $Id$
-
-This file is part of libmspdatafile
-Copyright © 2006-2008, 2010 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#ifndef MSP_DATAFILE_VALUE_H_
#define MSP_DATAFILE_VALUE_H_
#include <vector>
+#include <msp/core/attributes.h>
#include <msp/core/meta.h>
#include <msp/core/variant.h>
-#include "except.h"
#include "type.h"
namespace Msp {
Value(Symbol d): sig(TypeInfo<Symbol>::signature), data(d) { }
template<typename T>
- typename RemoveReference<T>::Type get() const
+ typename TypeInfo<T>::Load get() const
{ return get_<typename TypeInfo<T>::Store>(); }
char get_signature() const { return sig; }
T get_() const;
};
-typedef std::vector<Value> ValueArray __attribute__((deprecated));
-
template<typename T>
inline T Value::get_() const
{
- if(sig!=TypeInfo<T>::signature)
- throw TypeError("Type mismatch");
-
return data.value<typename TypeInfo<T>::Store>();
}
{
if(sig==IntType::signature)
return data.value<IntType::Store>();
- else if(sig!=FloatType::signature)
- throw TypeError("Type mismatch");
-
- return data.value<FloatType::Store>();
+ else
+ return data.value<FloatType::Store>();
}
} // namespace DataFile