/* ---------------------------------------------------------------------------- * GTSAM Copyright 2010, Georgia Tech Research Corporation, * Atlanta, Georgia 30332-0415 * All Rights Reserved * Authors: Frank Dellaert, et al. (see THANKS for the full author list) * See LICENSE for the license information * -------------------------------------------------------------------------- */ /** * @file types.h * @brief Typedefs for easier changing of types * @author Richard Roberts * @created Aug 21, 2010 */ #pragma once #include namespace gtsam { /** * Integer variable index type */ typedef size_t Index; /** Helper class that uses templates to select between two types based on * whether TEST_TYPE is const or not. */ template struct const_selector { }; /** Specialization for the non-const version */ template struct const_selector { typedef AS_NON_CONST type; }; /** Specialization for the const version */ template struct const_selector { typedef AS_CONST type; }; /** * Helper struct that encapsulates a value with a default, this is just used * as a member object so you don't have to specify defaults in the class * constructor. */ template struct ValueWithDefault { T value; ValueWithDefault() : value(defaultValue) { } ValueWithDefault(const T& _value) : value(_value) { } T& operator*() { return value; } }; }