00001 00009 /************************************************************************** 00010 00011 begin : Fri Oct 14 2005 00012 copyright : (C) 2002-2010 by Ewald Arnold 00013 email : mockpp at ewald-arnold dot de 00014 00015 This program is free software; you can redistribute it and/or modify 00016 it under the terms of the GNU Lesser General Public License as 00017 published by the Free Software Foundation; either version 2 of the License, 00018 or (at your option) any later version. 00019 00020 This program is distributed in the hope that it will be useful, 00021 but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 GNU General Public License for more details. 00024 00025 You should have received a copy of the GNU Lesser General Public License 00026 along with this program; if not, write to the Free Software 00027 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00028 00029 **/ 00030 00031 #define MOCKPP_NEED_EXPORTS 00032 #include <mockpp/mockpp.h> // always first 00033 00034 #include <mockpp/mockpp_dbc.h> 00035 #include <mockpp/visiting/VisitableMockMethod.h> 00036 00037 00038 MOCKPP_NS_START 00039 00040 00041 MOCKPP_API_IMPL0 VisitableMockMethodBase::VisitableMockMethodBase(const String &name, 00042 VisitableMockObject *parent) 00043 : MockObject(name, parent) 00044 , visitable(parent) 00045 , throwables (name + MOCKPP_PCHAR("/throwables"), this) 00046 , throwablesInline (true) 00047 { 00048 MOCKPP_PRE(parent != 0); 00049 MOCKPP_PRE(name.length() != 0); 00050 reset(); 00051 } 00052 00053 00054 MOCKPP_API_IMPL(String) VisitableMockMethodBase::getMethodName(bool fully) const 00055 { 00056 if (fully) 00057 return visitable->getVerifiableName() 00058 + MOCKPP_PCHAR(".") 00059 + getVerifiableName() 00060 + MOCKPP_PCHAR("."); 00061 00062 else 00063 return getVerifiableName(); 00064 } 00065 00066 00067 MOCKPP_API_IMPL(MOCKPP_STL::string) VisitableMockMethodBase::getMethodIdentifier() const 00068 { 00069 return getLatin1(getMethodName()); 00070 } 00071 00072 00073 MOCKPP_API_IMPL(VisitableMockObject *) VisitableMockMethodBase::getVisitableMockObject() const 00074 { 00075 return visitable; 00076 } 00077 00078 00079 MOCKPP_NS_END 00080