00001 /* *\ 00002 ** Copyright (C) 2009-2010 ** 00003 ** Dominik Charousset < Dominik.Charousset (at) haw-hamburg.de > ** 00004 ** ** 00005 ** MMM MMMMMM MMMMMMMMM MMMMMMM MMM MMM ** 00006 ** MMMMM MMMMMMMM MMMMMMMMM MMMMMMMM MMM MMMMM ** 00007 ** MMM MMM MMM MMMM MMM MMM MMM MMM MMM ** 00008 ** MMM MMM MMM MMMMMMMMM MMM MMM MMM MMM MMM ** 00009 ** MMMMMMMMMMM MMMM MMM MMMM MMM MMM MMM MMMMMMMMMMM ** 00010 ** MMM MMM MMMMMMMM MMMMMMMMM MMMMMMMM MMM MMM MMM ** 00011 ** MMM MMM MMMMMM MMMMMMMMM MMMMMMM MMM MMM MMM ** 00012 ** ** 00013 ** ** 00014 ** This file is part of the acedia library. ** 00015 ** ** 00016 ** This library is free software: you can redistribute it and/or modify ** 00017 ** it under the terms of the GNU Lesser General Public License as published ** 00018 ** by the Free Software Foundation, either version 3 of the License, or ** 00019 ** (at your option) any later version. ** 00020 ** ** 00021 ** This library is distributed in the hope that it will be useful, ** 00022 ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 00023 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 00024 ** GNU Lesser General Public License for more details. ** 00025 ** ** 00026 ** You should have received a copy of the GNU Lesser General Public License ** 00027 ** along with acedia. If not, see <http://www.gnu.org/licenses/>. ** 00028 \* */ 00029 00030 #define ACEDIA_REDUCED_ANNOUNCE 00031 00032 #include "tuple.hpp" 00033 00034 namespace acedia 00035 { 00036 namespace details 00037 { 00038 00039 TupleDataBase::TupleDataBase() : ReferenceCounted(1) { } 00040 00041 TupleDataBase::~TupleDataBase() { } 00042 00043 MetaClass *TupleDataBase::metaClassAt(unsigned int pos) const 00044 { 00045 if (pos < length()) return at(pos).metaClass(); 00046 return details::MetaClassImpl<void>::instance(); 00047 } 00048 00049 } // namespace details 00050 00051 Tuple::Tuple(details::TupleDataBase *p) : m_data(p) { } 00052 00053 Tuple::~Tuple() { if (!m_data->deref()) delete m_data; } 00054 00055 const Any &Tuple::at(boost::uint32_t pos) const 00056 { 00057 return m_data->at(pos); 00058 } 00059 00060 boost::uint32_t Tuple::length() const { return m_data->length(); } 00061 00062 bool Tuple::isTuple() const { return true; } 00063 00064 } // namespace acedia