00001 /****************************************************************************** 00002 * Copyright (C) 2014 by Ralf Kaestner * 00003 * ralf.kaestner@gmail.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the Lesser GNU General Public License as published by* 00007 * the Free Software Foundation; either version 3 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * Lesser GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the Lesser GNU General Public License * 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 00017 ******************************************************************************/ 00018 00019 #include "variant_topic_tools/BuiltinDataType.h" 00020 00021 namespace variant_topic_tools { 00022 00023 /*****************************************************************************/ 00024 /* Constructors and Destructor */ 00025 /*****************************************************************************/ 00026 00027 BuiltinDataType::BuiltinDataType() { 00028 } 00029 00030 BuiltinDataType::BuiltinDataType(const BuiltinDataType& src) : 00031 DataType(src) { 00032 } 00033 00034 BuiltinDataType::BuiltinDataType(const DataType& src) : 00035 DataType(src) { 00036 if (impl) 00037 BOOST_ASSERT(boost::dynamic_pointer_cast<Impl>(*impl)); 00038 } 00039 00040 BuiltinDataType::~BuiltinDataType() { 00041 } 00042 00043 BuiltinDataType::Impl::Impl(const std::string& identifier) : 00044 identifier(identifier) { 00045 } 00046 00047 BuiltinDataType::Impl::~Impl() { 00048 } 00049 00050 /*****************************************************************************/ 00051 /* Accessors */ 00052 /*****************************************************************************/ 00053 00054 bool BuiltinDataType::isNumeric() const { 00055 if (impl) 00056 return boost::dynamic_pointer_cast<Impl>(*impl)->isNumeric(); 00057 else 00058 return false; 00059 } 00060 00061 const std::string& BuiltinDataType::Impl::getIdentifier() const { 00062 return identifier; 00063 } 00064 00065 /*****************************************************************************/ 00066 /* Operators */ 00067 /*****************************************************************************/ 00068 00069 BuiltinDataType& BuiltinDataType::operator=(const DataType& src) { 00070 DataType::operator=(src); 00071 00072 if (impl) 00073 BOOST_ASSERT(boost::dynamic_pointer_cast<BuiltinDataType::Impl>(*impl)); 00074 00075 return *this; 00076 } 00077 00078 }