/* * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify * it under the terms of version 3 of the GNU Lesser General Public * License (LGPLv3) as published by the Free Software Foundation. * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU (Lesser) General Public License for more details. * * You should have received a copy of the GNU (Lesser) General Public * License along with Konclude. If not, see . * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CDOUBLEDYNAMICREFERENCEVECTOR_CPP #define KONCLUDE_UTILITIES_CONTAINER_CDOUBLEDYNAMICREFERENCEVECTOR_CPP #include "CDoubleDynamicReferenceVector.h" namespace Konclude { namespace Utilities { namespace Container { template CDoubleDynamicReferenceVectorBase::CDoubleDynamicReferenceVectorBase(CContext* context) : mFirstVector(context),mSecondVector(context) { clear(); } template CDoubleDynamicReferenceVectorBase::~CDoubleDynamicReferenceVectorBase() { } template const T CDoubleDynamicReferenceVectorBase::getData(cint64 index, const T& defaultValue) { if (index <= 0) { return mFirstVector.getData(-(index),defaultValue); } else { return mSecondVector.getData(index,defaultValue); } } template const T CDoubleDynamicReferenceVectorBase::getData(cint64 index, const T& defaultValue, bool* localFlag) { if (index <= 0) { return mFirstVector.getData(-(index),defaultValue,localFlag); } else { return mSecondVector.getData(index,defaultValue,localFlag); } } template const T CDoubleDynamicReferenceVectorBase::getLocalData(cint64 index, const T& defaultValue) { if (index <= 0) { return mFirstVector.getLocalData(-(index),defaultValue); } else { return mSecondVector.getLocalData(index,defaultValue); } } template const T CDoubleDynamicReferenceVectorBase::getReferenceData(cint64 index, const T& defaultValue) { if (index <= 0) { return mFirstVector.getReferenceData(-(index),defaultValue); } else { return mSecondVector.getReferenceData(index,defaultValue); } } template S* CDoubleDynamicReferenceVectorBase::setLocalData(cint64 index, const T& data) { if (index <= 0) { mFirstVector.setLocalData(-(index),data); } else { mSecondVector.setLocalData(index,data); } return (S*)this; } template S* CDoubleDynamicReferenceVectorBase::setData(cint64 index, const T& data) { if (index <= 0) { mFirstVector.setData(-(index),data); } else { mSecondVector.setData(index,data); } return (S*)this; } template bool CDoubleDynamicReferenceVectorBase::hasLocalData(cint64 index) { if (index <= 0) { return mFirstVector.hasLocalData(-(index)); } else { return mSecondVector.hasLocalData(index); } } template bool CDoubleDynamicReferenceVectorBase::hasData(cint64 index) { if (index <= 0) { return mFirstVector.hasData(-(index)); } else { return mSecondVector.hasData(index); } } template bool CDoubleDynamicReferenceVectorBase::hasReferencedData(cint64 index) { if (index <= 0) { return mFirstVector.hasReferencedData(-(index)); } else { return mSecondVector.hasReferencedData(index); } } template S* CDoubleDynamicReferenceVectorBase::clear() { mFirstVector.clear(); mSecondVector.clear(); return (S*)this; } template S* CDoubleDynamicReferenceVectorBase::referenceVector(CDoubleDynamicReferenceVectorBase* refVector) { clear(); mFirstVector.referenceVector(&refVector->mFirstVector); mSecondVector.referenceVector(&refVector->mSecondVector); return (S*)this; } template cint64 CDoubleDynamicReferenceVectorBase::getItemCount() { return mFirstVector.getItemCount()+mSecondVector.getItemCount(); } template cint64 CDoubleDynamicReferenceVectorBase::getItemMaxIndex() { return mSecondVector.getItemMaxIndex(); } template cint64 CDoubleDynamicReferenceVectorBase::getItemMinIndex() { return -mFirstVector.getItemMaxIndex(); } template cint64 CDoubleDynamicReferenceVectorBase::getReferencedItemCount() { return mFirstVector.getReferencedItemCount()+mSecondVector.getReferencedItemCount(); } template cint64 CDoubleDynamicReferenceVectorBase::getReferencedItemMaxIndex() { return mSecondVector.getItemCount(); } template cint64 CDoubleDynamicReferenceVectorBase::getReferencedItemMinIndex() { return -mFirstVector.getItemCount(); } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CDOUBLEDYNAMICREFERENCEVECTOR_CPP