23 #ifndef RPCREGISTERHELPERS_H
24 #define RPCREGISTERHELPERS_H
45 throw std::runtime_error(
"rpcextractor_base: no post defined for this data type.\n");
53 template<
typename T,
typename Tto>
62 template<
typename T,
typename Tfrom>
76 template<
typename T,
typename Tfrom>
213 std::complex<float> k =
static_cast<std::complex<float>
>(
pmt::to_complex(msg));
285 std::vector< signed char >
351 std::vector< std::complex<float> >
439 template <
typename T>
456 template<
typename T,
typename Tto>
461 const char* functionbase,
462 void (T::*
function)(Tto),
464 const char* units_ =
"",
465 const char* desc_ =
"",
474 d_minpriv = minpriv_;
475 d_display = display_;
477 #ifdef RPCSERVER_ENABLED
480 minpriv_, std::string(units_),
481 display_, std::string(desc_), min, max, def);
482 std::ostringstream oss(std::ostringstream::out);
483 oss << block_alias <<
"::" << functionbase;
492 const char* functionbase,
494 void (T::*
function)(Tto),
496 const char* units_ =
"",
497 const char* desc_ =
"",
506 d_minpriv = minpriv_;
507 d_display = display_;
509 #ifdef RPCSERVER_ENABLED
512 minpriv_, std::string(units_),
513 display_, std::string(desc_), min, max, def);
514 std::ostringstream oss(std::ostringstream::out);
515 oss << name <<
"::" << functionbase;
524 #ifdef RPCSERVER_ENABLED
533 std::string
units()
const {
return d_units; }
541 void units(std::string u) { d_units = u; }
549 std::string d_units, d_desc;
556 template<
typename T,
typename Tfrom>
563 const char* functionbase,
564 Tfrom (T::*
function)(),
566 const char* units_ =
"",
567 const char* desc_ =
"",
576 d_minpriv = minpriv_;
577 d_display = display_;
579 #ifdef RPCSERVER_ENABLED
582 minpriv_, std::string(units_), display_, std::string(desc_), min, max, def);
583 std::ostringstream oss(std::ostringstream::out);
584 oss << block_alias <<
"::" << functionbase;
594 const char* functionbase,
595 Tfrom (T::*
function)()
const,
597 const char* units_ =
"",
598 const char* desc_ =
"",
607 d_minpriv = minpriv_;
608 d_display = display_;
610 #ifdef RPCSERVER_ENABLED
613 minpriv_, std::string(units_), display_, std::string(desc_), min, max, def);
614 std::ostringstream oss(std::ostringstream::out);
615 oss << block_alias <<
"::" << functionbase;
625 const char* functionbase,
627 Tfrom (T::*
function)(),
629 const char* units_ =
"",
630 const char* desc_ =
"",
639 d_minpriv = minpriv_;
640 d_display = display_;
642 #ifdef RPCSERVER_ENABLED
645 minpriv_, std::string(units_), display_, std::string(desc_), min, max, def);
646 std::ostringstream oss(std::ostringstream::out);
647 oss << name <<
"::" << functionbase;
657 const char* functionbase,
659 Tfrom (T::*
function)()
const,
661 const char* units_ =
"",
662 const char* desc_ =
"",
671 d_minpriv = minpriv_;
672 d_display = display_;
674 #ifdef RPCSERVER_ENABLED
677 minpriv_, std::string(units_), display_, std::string(desc_), min, max, def);
678 std::ostringstream oss(std::ostringstream::out);
679 oss << name <<
"::" << functionbase;
688 #ifdef RPCSERVER_ENABLED
696 std::string
units()
const {
return d_units; }
704 void units(std::string u) { d_units = u; }
712 std::string d_units, d_desc;
725 template<
typename Tfrom>
741 throw std::runtime_error(
"ERROR: rpcbasic_register_variable called with no args. If this happens, someone has tried to use rpcbasic_register_variable incorrectly.");
745 const char* functionbase,
748 const char* units_ =
"",
749 const char* desc_ =
"",
753 min, max, def, units_, desc_, minpriv_, display_),
766 d_rpc_regset(
"FAIL",
"FAIL",this,&
rpcbasic_register_variable<Tfrom>::
get,pmt::
PMT_NIL,pmt::
PMT_NIL,pmt::
PMT_NIL,
DISPNULL,
"FAIL",
"FAIL",
RPC_PRIVLVL_MIN)
768 throw std::runtime_error(
"ERROR: rpcbasic_register_variable_rw called with no args. if this happens someone used rpcbasic_register_variable_rw incorrectly.\n");
772 const std::string& namebase,
773 const char* functionbase,
776 const char* units_ =
"",
777 const char* desc_ =
"",
781 d_rpc_regset(namebase,functionbase,this,&
rpcbasic_register_variable_rw::
set,min,max,def,units_,desc_,minpriv,display_)
Definition: rpcregisterhelpers.h:447
virtual void registerConfigureCallback(const std::string &id, const configureCallback_t callback)=0
rpcbasic_register_get< rpcbasic_register_variable< Tfrom >, Tfrom > d_rpc_reg
Definition: rpcregisterhelpers.h:729
Definition: rpccallbackregister_base.h:80
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:349
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:263
Tfrom get()
Definition: rpcregisterhelpers.h:731
PMT_API pmt_t from_complex(double re, double im)
Return a complex number constructed of the given real and imaginary parts.
rpcbasic_inserter(T *source, std::complex< double >(T::*func)())
Definition: rpcregisterhelpers.h:427
rpcbasic_register_get(const std::string &name, const char *functionbase, T *obj, Tfrom(T::*function)() const, const pmt::pmt_t &min, const pmt::pmt_t &max, const pmt::pmt_t &def, const char *units_="", const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN, DisplayType display_=DISPNULL)
Definition: rpcregisterhelpers.h:656
rpcbasic_inserter(T *source, std::vector< signed char >(T::*func)())
Definition: rpcregisterhelpers.h:279
PMT_API pmt_t init_s32vector(size_t k, const int32_t *data)
rpcbasic_register_variable()
Definition: rpcregisterhelpers.h:735
std::string units() const
Definition: rpcregisterhelpers.h:533
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:371
pmt::pmt_t def() const
Definition: rpcregisterhelpers.h:532
void set(Tfrom _variable)
Definition: rpcregisterhelpers.h:770
PMT_API std::complex< double > to_complex(pmt_t z)
rpcbasic_inserter(T *source, std::vector< int >(T::*func)())
Definition: rpcregisterhelpers.h:323
T * _source
Definition: rpcregisterhelpers.h:72
rpcbasic_register_variable_rw()
Definition: rpcregisterhelpers.h:765
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:69
float min(float a, float b)
rpcbasic_register_set(const std::string &block_alias, const char *functionbase, void(T::*function)(Tto), const pmt::pmt_t &min, const pmt::pmt_t &max, const pmt::pmt_t &def, const char *units_="", const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN, DisplayType display_=DISPNULL)
Definition: rpcregisterhelpers.h:460
rpcbasic_inserter(T *source, std::vector< short >(T::*func)() const)
Definition: rpcregisterhelpers.h:297
PMT_API pmt_t init_u8vector(size_t k, const uint8_t *data)
rpcbasic_inserter(T *source, std::complex< float >(T::*func)())
Definition: rpcregisterhelpers.h:407
Tfrom * d_variable
Definition: rpcregisterhelpers.h:730
Definition: rpcregisterhelpers.h:760
Definition: rpcregisterhelpers.h:440
rpcbasic_inserter(T *source, std::vector< short >(T::*func)())
Definition: rpcregisterhelpers.h:301
PMT_API pmt_t init_s8vector(size_t k, const int8_t *data)
Virtual base class that produces messages.
Definition: msg_producer.h:35
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:411
rpcbasic_inserter(T *source, std::vector< uint8_t >(T::*func)())
Definition: rpcregisterhelpers.h:387
std::string description() const
Definition: rpcregisterhelpers.h:534
priv_lvl_t
Definition: rpccallbackregister_base.h:46
void default_display(DisplayType d)
Definition: rpcregisterhelpers.h:544
void privilege_level(priv_lvl_t p)
Definition: rpcregisterhelpers.h:706
unsigned char uint8_t
Definition: stdint.h:78
pmt::pmt_t max() const
Definition: rpcregisterhelpers.h:531
void units(std::string u)
Definition: rpcregisterhelpers.h:704
Definition: rpcregisterhelpers.h:63
PMT_API pmt_t intern(const std::string &s)
Alias for pmt_string_to_symbol.
virtual void unregisterConfigureCallback(const std::string &id)=0
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:283
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:391
PMT_API const std::string symbol_to_string(const pmt_t &sym)
static int count
Definition: rpcregisterhelpers.h:443
void set_max(pmt::pmt_t p)
Definition: rpcregisterhelpers.h:702
PMT_API bool to_bool(pmt_t val)
Return true if val is pmt::True, return false when val is pmt::PMT_F,.
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
rpcbasic_inserter(T *source, uint64_t(T::*func)())
Definition: rpcregisterhelpers.h:259
Definition: rpccallbackregister_base.h:48
Tfrom(T::* _func)()
Definition: rpcregisterhelpers.h:73
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:89
Definition: rpcregisterhelpers.h:557
virtual void registerQueryCallback(const std::string &id, const queryCallback_t callback)=0
void privilege_level(priv_lvl_t p)
Definition: rpcregisterhelpers.h:543
Definition: rpcregisterhelpers.h:77
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:327
PMT_API pmt_t from_uint64(uint64_t x)
Return the pmt value that represents the uint64 x.
rpcbasic_register_variable_rw(const std::string &namebase, const char *functionbase, Tfrom *variable, const pmt::pmt_t &min, const pmt::pmt_t &max, const pmt::pmt_t &def, const char *units_="", const char *desc_="", priv_lvl_t minpriv=RPC_PRIVLVL_MIN, DisplayType display_=DISPNULL)
Definition: rpcregisterhelpers.h:771
rpcbasic_register_set(const std::string &name, const char *functionbase, T *obj, void(T::*function)(Tto), const pmt::pmt_t &min, const pmt::pmt_t &max, const pmt::pmt_t &def, const char *units_="", const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN, DisplayType display_=DISPNULL)
Definition: rpcregisterhelpers.h:491
virtual ~rpcbasic_base()
Definition: rpcregisterhelpers.h:451
void set_def(pmt::pmt_t p)
Definition: rpcregisterhelpers.h:703
priv_lvl_t privilege_level() const
Definition: rpcregisterhelpers.h:698
virtual void unregisterQueryCallback(const std::string &id)=0
rpcbasic_register_variable(const std::string &namebase, const char *functionbase, Tfrom *variable, const pmt::pmt_t &min, const pmt::pmt_t &max, const pmt::pmt_t &def, const char *units_="", const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN, DisplayType display_=DISPNULL)
Definition: rpcregisterhelpers.h:744
rpcinserter_base(T *source, Tfrom(T::*func)())
Definition: rpcregisterhelpers.h:66
rpcbasic_register_get(const std::string &name, const char *functionbase, T *obj, Tfrom(T::*function)(), const pmt::pmt_t &min, const pmt::pmt_t &max, const pmt::pmt_t &def, const char *units_="", const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN, DisplayType display_=DISPNULL)
Definition: rpcregisterhelpers.h:624
unsigned __int64 uint64_t
Definition: stdint.h:90
rpcbasic_register_get(const std::string &block_alias, const char *functionbase, Tfrom(T::*function)(), const pmt::pmt_t &min, const pmt::pmt_t &max, const pmt::pmt_t &def, const char *units_="", const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN, DisplayType display_=DISPNULL)
Definition: rpcregisterhelpers.h:562
Virtual base class that accepts messages.
Definition: messages/msg_accepter.h:35
rpcbasic_inserter(T *source, uint64_t(T::*func)() const)
Definition: rpcregisterhelpers.h:255
void set_max(pmt::pmt_t p)
Definition: rpcregisterhelpers.h:539
PMT_API long to_long(pmt_t x)
Convert pmt to long if possible.
virtual rpcserver_base * i()=0
PMT_API double to_double(pmt_t x)
Convert pmt to double if possible.
void setptr(Tfrom *_variable)
Definition: rpcregisterhelpers.h:734
static rpcserver_booter_base * get()
pmt::pmt_t max() const
Definition: rpcregisterhelpers.h:694
rpcbasic_inserter(T *source, std::vector< float >(T::*func)())
Definition: rpcregisterhelpers.h:367
~rpcbasic_register_get()
Definition: rpcregisterhelpers.h:686
pmt::pmt_t min() const
Definition: rpcregisterhelpers.h:693
rpcbasic_inserter(T *source, std::vector< int >(T::*func)() const)
Definition: rpcregisterhelpers.h:319
Definition: rpcregisterhelpers.h:726
priv_lvl_t privilege_level() const
Definition: rpcregisterhelpers.h:535
const uint32_t DISPNULL
Definition: rpccallbackregister_base.h:32
rpcbasic_inserter(T *source, std::vector< float >(T::*func)() const)
Definition: rpcregisterhelpers.h:363
void set_def(pmt::pmt_t p)
Definition: rpcregisterhelpers.h:540
PMT_API pmt_t init_f32vector(size_t k, const float *data)
VOLK_API void(kern.name) _manual($kern.arglist_full
Call into a specific implementation given by name.
DisplayType default_display() const
Definition: rpcregisterhelpers.h:536
pmt::pmt_t def() const
Definition: rpcregisterhelpers.h:695
rpcbasic_inserter(T *source, std::vector< uint8_t >(T::*func)() const)
Definition: rpcregisterhelpers.h:383
pmt::pmt_t min() const
Definition: rpcregisterhelpers.h:530
rpcinserter_base()
Definition: rpcregisterhelpers.h:67
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:431
PMT_API pmt_t init_c32vector(size_t k, const std::complex< float > *data)
std::string units() const
Definition: rpcregisterhelpers.h:696
VOLK_API $kern pname $kern name
A function pointer to the dispatcher implementation.
GR_RUNTIME_API gr::block_registry global_block_registry
rpcbasic_inserter(T *source, std::complex< float >(T::*func)() const)
Definition: rpcregisterhelpers.h:403
rpcbasic_register_get(const std::string &block_alias, const char *functionbase, Tfrom(T::*function)() const, const pmt::pmt_t &min, const pmt::pmt_t &max, const pmt::pmt_t &def, const char *units_="", const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN, DisplayType display_=DISPNULL)
Definition: rpcregisterhelpers.h:593
rpcbasic_inserter(T *source, Tfrom(T::*func)())
Definition: rpcregisterhelpers.h:85
void set_min(pmt::pmt_t p)
Definition: rpcregisterhelpers.h:538
rpcbasic_base()
Definition: rpcregisterhelpers.h:450
std::string description() const
Definition: rpcregisterhelpers.h:697
void units(std::string u)
Definition: rpcregisterhelpers.h:541
~rpcbasic_register_set()
Definition: rpcregisterhelpers.h:522
void default_display(DisplayType d)
Definition: rpcregisterhelpers.h:707
rpcbasic_inserter(T *source, std::complex< double >(T::*func)() const)
Definition: rpcregisterhelpers.h:423
void description(std::string d)
Definition: rpcregisterhelpers.h:542
boost::intrusive_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
Definition: pmt.h:56
void set_min(pmt::pmt_t p)
Definition: rpcregisterhelpers.h:701
rpc_register_base()
Definition: rpcregisterhelpers.h:442
rpcbasic_inserter(T *source, std::vector< std::complex< float > >(T::*func)() const)
Definition: rpcregisterhelpers.h:341
PMT_API pmt_t init_s16vector(size_t k, const int16_t *data)
rpcbasic_inserter(T *source, Tfrom(T::*func)() const)
Definition: rpcregisterhelpers.h:81
basic_block_sptr block_lookup(pmt::pmt_t symbol)
rpcbasic_inserter(T *source, std::vector< signed char >(T::*func)() const)
Definition: rpcregisterhelpers.h:275
void description(std::string d)
Definition: rpcregisterhelpers.h:705
pmt::pmt_t retrieve()
send msg to msg_producer
Definition: rpcregisterhelpers.h:305
static pmt_t mp(const std::string &s)
Make pmt symbol.
Definition: pmt_sugar.h:36
unsigned char bool
Definition: stdbool.h:30
DisplayType default_display() const
Definition: rpcregisterhelpers.h:699
rpcbasic_inserter(T *source, std::vector< std::complex< float > >(T::*func)())
Definition: rpcregisterhelpers.h:345
PMT_API const pmt_t PMT_NIL
uint32_t DisplayType
Definition: rpccallbackregister_base.h:29
Definition: rpcregisterhelpers.h:457