some fixes

This commit is contained in:
AndreaRigoni
2015-07-30 18:40:04 +02:00
parent dd13aa342f
commit d9de462dae
7 changed files with 35 additions and 31 deletions

View File

@@ -33,7 +33,7 @@ namespace uLib {
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// RUNTIME CLASS FACTORY not jet usable... classes under development !
// RUNTIME CLASS FACTORY not usable yet... classes under development !
template <

View File

@@ -60,23 +60,22 @@ class SequenceCombiner {
typedef typename mpl::end<in_seq>::type Itr_end;
typedef typename mpl::if_< boost::is_same<Itr_next,Itr_end>,
typename mpl::push_back<seq,Itr_begin>::type,
typename mpl::push_back<seq,Itr_next>::type
>::type
typename mpl::push_back<seq,Itr_begin>::type,
typename mpl::push_back<seq,Itr_next>::type
>::type
new_seq;
typedef typename mpl::if_< boost::is_same<Itr_next,Itr_end>,
mpl::int_<1>,
mpl::int_<0>
>::type
mpl::int_<1>,
mpl::int_<0>
>::type
new_state;
public:
typedef typename set_state<new_seq, new_state>::type type;
};
};
typedef typename mpl::fold<
typename mpl::zip_view< mpl::vector<Seq, ItrSeq > >::type,
typedef typename mpl::fold< typename mpl::zip_view< mpl::vector<Seq, ItrSeq > >::type,
StateSeq<>,
NextOp
>::type
@@ -86,7 +85,8 @@ public:
typedef typename mpl::if_< boost::is_same< typename StateResult::state, int_<1> >,
typename mpl::transform< Seq, mpl::end<_1> >::type,
typename StateResult::sequence >::type
typename StateResult::sequence
>::type
next;
};

View File

@@ -169,7 +169,7 @@ class ProgrammableAccessor : public Named {
public:
ProgrammableAccessor() : Named("") {}
ProgrammableAccessor() {}
ProgrammableAccessor(const char *name) : Named(name) {}
@@ -223,23 +223,23 @@ public:
}
// ------ //
/*
// struct Wrapper {
// Wrapper(const ProgrammableAccessor<D> *ac, void *ob) :
// m_access(ac), m_object(ob)
// { assert(ob != NULL); }
// template <typename T>
// inline T Get() const { return static_cast<T>(m_access->Get(m_object)); }
struct Wrapper {
Wrapper(const ProgrammableAccessor<D> *ac, void *ob) :
m_access(ac), m_object(ob)
{ assert(ob != NULL); }
// template <typename T>
// inline void Set(const T data) const { return m_access->Set(m_object,static_cast<T>(data)); }
template <typename T>
inline T Get() const { return static_cast<T>(m_access->Get(m_object)); }
template <typename T>
inline void Set(const T data) const { return m_access->Set(m_object,static_cast<T>(data)); }
void *m_object;
const ProgrammableAccessor<D> *m_access;
};
const Wrapper operator() (void *ob) const { return Wrapper(this,ob); }
// void *m_object;
// const ProgrammableAccessor<D> *m_access;
// };
// const Wrapper operator() (void *ob) const { return Wrapper(this,ob); }
*/
inline D Get(void *ob) const { return m_base->Get(ob); }

View File

@@ -134,7 +134,7 @@ struct IsInterfaceOf {
} // uLib
#define ULIB_INTERFACE_ASSERT(interface, type) \
BOOST_CONCEPT_ASSERT(( uLib::IsInterfaceOf<interface,type> ))
BOOST_CONCEPT_ASSERT(( uLib::IsInterfaceOf< interface, type > ))

View File

@@ -88,6 +88,7 @@ private:
};
}

View File

@@ -30,8 +30,10 @@
#include "Math/Dense.h"
#include "Math/ContainerBox.h"
#include "Math/StructuredData.h"
//#include "Math/StructuredData.h"
#include "Math/ImageMap.h"
#include "Math/DataSet.h"
#include "Math/VoxImage.h"
#include <iostream>
@@ -53,7 +55,7 @@ int main() {
Data data;
VectorData<Data> vd;
VoxImage<Data> vd;
vd.push_back(data);
vd.push_back(Data());
vd.push_back(Data());
@@ -77,7 +79,7 @@ int main2() {
BEGIN_TESTING(Structured Data);
{ // testing unmap function ////////////////////////////////////////////////
StructuredData sdata(Vector3i(2,3,4));
ImageMap sdata(Vector3i(2,3,4));
for(int i=0; i < sdata.GetDims().prod() ; ++i) {
Vector3i d = sdata.UnMap(i);
std::cout << "TEST1( sdata.UnMap(" << i << ") == Vector3i("

View File

@@ -27,6 +27,7 @@
#include "testing-prototype.h"
#include "Math/VectorSpace.h"
#include "Math/ImageData.h"
#include "Math/VoxImage.h"