00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef MOCKPP_VISITABLEMOCKOBJECT_TEMPLATE_H
00032 #define MOCKPP_VISITABLEMOCKOBJECT_TEMPLATE_H
00033
00034 #include <mockpp/constraint/ConstraintHolder.h>
00035 #include <mockpp/constraint/IsEqual.h>
00036
00037
00038 MOCKPP_NS_START
00039
00040
00041 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00042
00043
00047 class ResponseVectorBase : public Verifiable
00048 {
00049 public:
00050
00055 ResponseVectorBase(const String &name, VerifiableList *parent)
00056 : Verifiable(name, parent),
00057 tvec(name+MOCKPP_PCHAR("/tvec") , 0)
00058 {
00059 }
00060
00063 virtual void verify()
00064 {
00065
00066
00067 unsigned unused = 0;
00068 MOCKPP_STL::vector<unsigned>::const_iterator start = counter.begin();
00069 MOCKPP_STL::vector<unsigned>::const_iterator end = counter.end();
00070 for ( ; start != end; ++start)
00071 if (*start != MOCKPP_UNLIMITED)
00072 unused += *start;
00073
00074 String fmt = mockpp_i18n(MOCKPP_PCHAR("%1 has a total of %2 un-used response objects."));
00075 fmt << getVerifiableName() << unused;
00076
00077 MOCKPP_ASSERT_EQUALS_MESSAGE(fmt, (unsigned)0, unused);
00078 }
00079
00080
00084 unsigned size() const
00085 {
00086 return counter.size();
00087 }
00088
00089
00090 protected:
00091
00092 ThrowableList tvec;
00093 MOCKPP_STL::vector<unsigned> counter;
00094 };
00095
00096
00097 #endif // DOXYGEN_SHOULD_SKIP_THIS
00098
00099
00100 MOCKPP_NS_END
00101
00102
00103 #include "ResponseVector1.h"
00104 #include "ResponseVector2.h"
00105 #include "ResponseVector3.h"
00106 #include "ResponseVector4.h"
00107 #include "ResponseVector5.h"
00108
00109
00110 #endif // MOCKPP_VISITABLEMOCKOBJECT_TEMPLATE_H
00111