Browse Source

Gmt module: Replace ObjectList::ListValues::size_type on ObjectList::IndexType.

ParameterTemplates
Michael Uleysky 8 years ago
parent
commit
afc5ae64d8
  1. 6
      modules/gmt/modgmt_func.h
  2. 6
      modules/gmt/modgmt_map.cpp

6
modules/gmt/modgmt_func.h

@ -22,7 +22,7 @@ class Base2Something: public OBTypeM<Func,O...>
public:
Base2Something(const ObjectBase* arg):OBTypeM<Func,O...>(arg) {};
Base2Something(const ObjectList* input, const std::string& name):OBTypeM<Func,O...>(input->Find(name)){};
Base2Something(const ObjectList* input, const ObjectList::ListValues::size_type i):OBTypeM<Func,O...>((i<input->Size())?input->At(i):0){}; // Check index, because At is not safe
Base2Something(const ObjectList* input, const ObjectList::IndexType i):OBTypeM<Func,O...>((i<input->Size())?input->At(i):0){}; // Check index, because At is not safe
template<class... Args>
auto operator ()(bool* b, Args... args) const -> decltype(this->OBTypeM<Func,O...>::template operator()<bool*, Args...>(b, args...))
{
@ -149,7 +149,7 @@ struct SearchHelper<Struct,true>
{
void operator()(const ObjectList* input, Struct* s, bool* exist, bool* ok) const
{
for(ObjectList::ListValues::size_type i=0;i<input->Size();i++)
for(ObjectList::IndexType i=0;i<input->Size();i++)
{
OBType<ObjectGMTClass<Struct> > obj(input->At(i));
if(obj)
@ -194,7 +194,7 @@ class SearchParameter<Struct,SearchByType>
// Bottom of recursion
SearchParameter(const ObjectList* input):exist(false),ok(true) {SearchHelper<Struct,SearchByType>()(input,&val,&exist,&ok);}
// Search by index
SearchParameter(const ObjectList* input, const ObjectList::ListValues::size_type i):exist(false),ok(true)
SearchParameter(const ObjectList* input, const ObjectList::IndexType i):exist(false),ok(true)
{
Base2Struct a(input,i);
if(a.Exist())

6
modules/gmt/modgmt_map.cpp

@ -247,7 +247,7 @@ const ObjectBase* GMT_Convert2PDF(const ObjectList* input)
}
{
for(ObjectList::ListValues::size_type i=0;i<input->Size();i++)
for(ObjectList::IndexType i=0;i<input->Size();i++)
{
OBType<ObjectGMTMap> m(input->At(i));
if(m)
@ -298,7 +298,7 @@ const ObjectBase* GMT_Convert2PNG(const ObjectList* input)
// Map to convert
{
for(ObjectList::ListValues::size_type i=0;i<input->Size();i++)
for(ObjectList::IndexType i=0;i<input->Size();i++)
{
OBType<ObjectGMTMap> m(input->At(i));
OBType<ObjectGMTMapPDF> p(input->At(i));
@ -422,7 +422,7 @@ const ObjectBase* GMT_Convert2JPG(const ObjectList* input)
// Map to convert
{
for(ObjectList::ListValues::size_type i=0;i<input->Size();i++)
for(ObjectList::IndexType i=0;i<input->Size();i++)
{
OBType<ObjectGMTMap> m(input->At(i));
OBType<ObjectGMTMapPDF> p(input->At(i));

Loading…
Cancel
Save