Skip to content

Commit

Permalink
added getters and setters
Browse files Browse the repository at this point in the history
  • Loading branch information
swarnavaghosh04 committed Sep 15, 2024
1 parent 331df38 commit 049f33a
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/doxygen/other/group_defs.dox
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* \defgroup block GNU Radio UTAT_HERON C++ Signal Processing Blocks
* \defgroup block Signal Processing Blocks
* \brief All C++ blocks that can be used from the UTAT_HERON GNU Radio
* module are listed here or in the subcategories below.
*
Expand Down
12 changes: 12 additions & 0 deletions include/gnuradio/UTAT_HERON/tagged_stream_fixed_length_padder.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ class UTAT_HERON_API tagged_stream_fixed_length_padder
uint8_t filler,
int additional_symb_overflow
);

virtual std::string get_len_tag_key() = 0;
virtual double get_final_samples_per_symbol() = 0;
virtual int get_final_buffer_len() = 0;
virtual uint8_t get_filler() = 0;
virtual int get_additional_symb_overflow() = 0;

virtual void set_len_tag_key(std::string s) = 0;
virtual void set_final_samples_per_symbol(double d) = 0;
virtual void set_final_buffer_len(int i) = 0;
virtual void set_filler(uint8_t c) = 0;
virtual void set_additional_symb_overflow(int i) = 0;
};

} // namespace UTAT_HERON
Expand Down
11 changes: 11 additions & 0 deletions lib/tagged_stream_fixed_length_padder_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,16 @@ int tagged_stream_fixed_length_padder_impl::work(int noutput_items,

}

std::string tagged_stream_fixed_length_padder_impl::get_len_tag_key(){ return d_length_tag_key_str; }
double tagged_stream_fixed_length_padder_impl::get_final_samples_per_symbol(){ return d_sps; }
int tagged_stream_fixed_length_padder_impl::get_final_buffer_len(){ return d_buffer_len; }
uint8_t tagged_stream_fixed_length_padder_impl::get_filler(){ return d_filler; }
int tagged_stream_fixed_length_padder_impl::get_additional_symb_overflow(){ return d_additional_symb_overflow; }
void tagged_stream_fixed_length_padder_impl::set_len_tag_key(std::string s){ d_length_tag_key_str = std::move(s); }
void tagged_stream_fixed_length_padder_impl::set_final_samples_per_symbol(double d){ d_sps = d; }
void tagged_stream_fixed_length_padder_impl::set_final_buffer_len(int i){ d_buffer_len = i; }
void tagged_stream_fixed_length_padder_impl::set_filler(uint8_t c){ d_filler = c; }
void tagged_stream_fixed_length_padder_impl::set_additional_symb_overflow(int i){ d_additional_symb_overflow = i; }

} /* namespace UTAT_HERON */
} /* namespace gr */
13 changes: 12 additions & 1 deletion lib/tagged_stream_fixed_length_padder_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class tagged_stream_fixed_length_padder_impl : public tagged_stream_fixed_length
uint8_t d_filler;
int d_samps_overflow;
int d_len;
int d_additional_samp_overflow;
int d_additional_symb_overflow;

protected:
Expand All @@ -43,6 +42,18 @@ class tagged_stream_fixed_length_padder_impl : public tagged_stream_fixed_length
gr_vector_int& ninput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items);

std::string get_len_tag_key() override;
double get_final_samples_per_symbol() override;
int get_final_buffer_len() override;
uint8_t get_filler() override;
int get_additional_symb_overflow() override;

void set_len_tag_key(std::string) override;
void set_final_samples_per_symbol(double) override;
void set_final_buffer_len(int) override;
void set_filler(uint8_t) override;
void set_additional_symb_overflow(int) override;
};

} // namespace UTAT_HERON
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Free Software Foundation, Inc.
* Copyright 2024 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
Expand All @@ -14,7 +14,7 @@
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(tagged_stream_fixed_length_padder.h) */
/* BINDTOOL_HEADER_FILE_HASH(6107c1c86b61dfa0ad595a4f2ffcf6cc) */
/* BINDTOOL_HEADER_FILE_HASH(0d772c5e6aa39601ce45854cb2da310f) */
/***********************************************************************************/

#include <pybind11/complex.h>
Expand Down Expand Up @@ -48,6 +48,64 @@ void bind_tagged_stream_fixed_length_padder(py::module& m)
py::arg("additional_symb_overflow"),
D(tagged_stream_fixed_length_padder, make))

.def(
"get_len_tag_key",
&tagged_stream_fixed_length_padder::get_len_tag_key,
D(tagged_stream_fixed_length_padder, get_len_tag_key)
)

.def(
"get_final_samples_per_symbol",
&tagged_stream_fixed_length_padder::get_final_samples_per_symbol,
D(tagged_stream_fixed_length_padder, get_final_samples_per_symbol)
)

.def(
"get_final_buffer_len",
&tagged_stream_fixed_length_padder::get_final_buffer_len,
D(tagged_stream_fixed_length_padder, get_final_buffer_len)
)

.def(
"get_filler",
&tagged_stream_fixed_length_padder::get_filler,
D(tagged_stream_fixed_length_padder, get_filler)
)

.def(
"set_len_tag_key",
&tagged_stream_fixed_length_padder::set_len_tag_key,
py::arg("s"),
D(tagged_stream_fixed_length_padder, set_len_tag_key)
)

.def(
"set_final_samples_per_symbol",
&tagged_stream_fixed_length_padder::set_final_samples_per_symbol,
py::arg("d"),
D(tagged_stream_fixed_length_padder, set_final_samples_per_symbol)
)

.def(
"set_final_buffer_len",
&tagged_stream_fixed_length_padder::set_final_buffer_len,
py::arg("i"),
D(tagged_stream_fixed_length_padder, set_final_buffer_len)
)

.def(
"set_filler",
&tagged_stream_fixed_length_padder::set_filler,
py::arg("c"),
D(tagged_stream_fixed_length_padder, set_filler)
)

.def(
"set_additional_symb_overflow",
&tagged_stream_fixed_length_padder::set_additional_symb_overflow,
py::arg("i"),
D(tagged_stream_fixed_length_padder, set_additional_symb_overflow)
)

;
}

0 comments on commit 049f33a

Please sign in to comment.