Issue when creating a filter in presend

19 views
Skip to first unread message

Stefano Rosati

unread,
May 22, 2018, 8:24:20 AM5/22/18
to ngrest
Hi folks!

I have this error when i try to add a filter to my services.
Everything is running fine without it, but i'm not able to build using the macro NGREST_DECLARE_PLUGIN(::ngrest::JsonFilterGroup)  where JsonFilterGroup is my filtergroup 

Here is the error:

CMakeFiles/cass_tck_plugin.dir/codegen/ServiceGroupImpl.cpp.o: In function `std::iterator_traits<ngrest::ServiceWrapper* const*>::iterator_category std::__iterator_category<ngrest::ServiceWrapper* const*>(ngrest::ServiceWrapper* const* const&)':
/home/stefano/devel/repo_sport/src/cassandra_tck_cache/cass_tck_plugin/.ngrest/local/build/cass_tck_plugin/codegen/ServiceGroupImpl.cpp:13: multiple definition of `ngrestPlugin'
CMakeFiles/cass_tck_plugin.dir/src/json_filter_group.cpp.o:/home/stefano/devel/repo_sport/src/cassandra_tck_cache/cass_tck_plugin/cass_tck_plugin/src/json_filter_group.cpp:19: first defined here

and here the json_filter_group.cpp file 
#include <ngrest/utils/PluginExport.h>

#include "json_filter.h"
#include "json_filter_group.h"


NGREST_DECLARE_PLUGIN(::ngrest::JsonFilterGroup) ;

namespace ngrest {

JsonFilterGroup::JsonFilterGroup():
filters({
  {ngrest::Phase::PreSend , {new ::ngrest::JsonFilter()}}
  }) {
}

JsonFilterGroup::~JsonFilterGroup() {
for (auto it : filters)
for (ngrest::Filter* filter : it.second)
delete filter;
filters.clear();
}

       const std::string& JsonFilterGroup::getName() const  {
static const std::string name = "JsonFilterGroup";
return name;

}
      const ngrest::FiltersMap& JsonFilterGroup::getFilters() const  {
return filters;
     }
}


Any suggestion? TIA


Stefano Rosati

unread,
May 23, 2018, 1:33:25 PM5/23/18
to ngrest
No matter!! I made a mistake and i have fixed by my own
Thanks anyway :)

--
You received this message because you are subscribed to the Google Groups "ngrest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngrest+unsubscribe@googlegroups.com.
To post to this group, send email to ngr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ngrest/8974d174-ebd8-4487-ac4b-791093cc46ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages