Skip to content

Commit

Permalink
Adding Doxygen commentary style to teca_algorithm_fwd macros
Browse files Browse the repository at this point in the history
  • Loading branch information
elbashandy committed Mar 16, 2021
1 parent b399af0 commit 2338f87
Showing 1 changed file with 79 additions and 68 deletions.
147 changes: 79 additions & 68 deletions core/teca_algorithm_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ std::shared_ptr<T const> shared_from_this() const \
}

#define TECA_ALGORITHM_CLASS_NAME(T) \
/** returns the name of the class */ \
const char *get_class_name() const override \
{ \
return #T; \
Expand All @@ -50,20 +51,22 @@ const char *get_class_name() const override \
// convenience macro to declare standard set_NAME/get_NAME methods
// where NAME is the name of a class member. will manage the
// algorithm's modified state for the user.
#define TECA_ALGORITHM_PROPERTY(T, NAME) \
\
void set_##NAME(const T &v) \
{ \
if (this->NAME != v) \
{ \
this->NAME = v; \
this->set_modified(); \
} \
} \
\
const T &get_##NAME() const \
{ \
return this->NAME; \
#define TECA_ALGORITHM_PROPERTY(T, NAME) \
\
/** Set the value of the @ref NAME algorithm property */ \
void set_##NAME(const T &v) \
{ \
if (this->NAME != v) \
{ \
this->NAME = v; \
this->set_modified(); \
} \
} \
\
/** Get the value of the @ref NAME algorithm property */ \
const T &get_##NAME() const \
{ \
return this->NAME; \
}

// similar to TECA_ALGORITHM_PROPERTY but prior to setting NAME
Expand Down Expand Up @@ -93,60 +96,68 @@ const T &get_##NAME() const \
// convenience macro to declare standard set_NAME/get_NAME methods
// where NAME is the name of a class member. will manage the
// algorithm's modified state for the user.
#define TECA_ALGORITHM_VECTOR_PROPERTY(T, NAME) \
\
size_t get_number_of_##NAME##s () \
{ \
return this->NAME##s.size(); \
} \
\
void append_##NAME(const T &v) \
{ \
this->NAME##s.push_back(v); \
this->set_modified(); \
} \
\
void set_##NAME(size_t i, const T &v) \
{ \
if (this->NAME##s[i] != v) \
{ \
this->NAME##s[i] = v; \
this->set_modified(); \
} \
} \
\
void set_##NAME##s(const std::vector<T> &v) \
{ \
if (this->NAME##s != v) \
{ \
this->NAME##s = v; \
this->set_modified(); \
} \
} \
\
void set_##NAME##s(const std::initializer_list<T> &&l) \
{ \
std::vector<T> v(l); \
if (this->NAME##s != v) \
{ \
this->NAME##s = v; \
this->set_modified(); \
} \
} \
\
const T &get_##NAME(size_t i) const \
{ \
return this->NAME##s[i]; \
} \
\
const std::vector<T> &get_##NAME##s() const \
{ \
return this->NAME##s; \
} \
\
void clear_##NAME##s() \
{ \
this->NAME##s.clear(); \
#define TECA_ALGORITHM_VECTOR_PROPERTY(T, NAME) \
\
/** get the size of the @ref NAME##s algorithm vector property */ \
size_t get_number_of_##NAME##s () \
{ \
return this->NAME##s.size(); \
} \
\
/** append to the @ref NAME##s algorithm vector property */ \
void append_##NAME(const T &v) \
{ \
this->NAME##s.push_back(v); \
this->set_modified(); \
} \
\
/** set the i-th element of the @ref NAME##s algorithm vector property */ \
void set_##NAME(size_t i, const T &v) \
{ \
if (this->NAME##s[i] != v) \
{ \
this->NAME##s[i] = v; \
this->set_modified(); \
} \
} \
\
/** set the @ref NAME##s algorithm vector property */ \
void set_##NAME##s(const std::vector<T> &v) \
{ \
if (this->NAME##s != v) \
{ \
this->NAME##s = v; \
this->set_modified(); \
} \
} \
\
/** set the @ref NAME##s algorithm vector property */ \
void set_##NAME##s(const std::initializer_list<T> &&l) \
{ \
std::vector<T> v(l); \
if (this->NAME##s != v) \
{ \
this->NAME##s = v; \
this->set_modified(); \
} \
} \
\
/** get the i-th element of the @ref NAME##s algorithm vector property */ \
const T &get_##NAME(size_t i) const \
{ \
return this->NAME##s[i]; \
} \
\
/** get the @ref NAME##s algorithm vector property */ \
const std::vector<T> &get_##NAME##s() const \
{ \
return this->NAME##s; \
} \
\
/** clear the @ref NAME##s algorithm vector property */ \
void clear_##NAME##s() \
{ \
this->NAME##s.clear(); \
}


Expand Down

0 comments on commit 2338f87

Please sign in to comment.