From 81ab5a691480af2dc67d0cec5ba87157f30dfb01 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Sat, 18 Apr 2020 14:03:37 +0200 Subject: [PATCH] As discussed, renamed Cookie to CookieIF. Also added documentation on the purpose of this class --- devicehandlers/Cookie.h | 10 ---------- devicehandlers/CookieIF.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 10 deletions(-) delete mode 100644 devicehandlers/Cookie.h create mode 100644 devicehandlers/CookieIF.h diff --git a/devicehandlers/Cookie.h b/devicehandlers/Cookie.h deleted file mode 100644 index 495c8c40..00000000 --- a/devicehandlers/Cookie.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef COOKIE_H_ -#define COOKIE_H_ - -class Cookie{ -public: - virtual ~Cookie(){} -}; - - -#endif /* COOKIE_H_ */ diff --git a/devicehandlers/CookieIF.h b/devicehandlers/CookieIF.h new file mode 100644 index 00000000..6b2bb559 --- /dev/null +++ b/devicehandlers/CookieIF.h @@ -0,0 +1,34 @@ +#ifndef COOKIE_H_ +#define COOKIE_H_ +#include +#include + +/** + * @brief Physical address type + */ +typedef uint32_t address_t; + +/** + * @brief This datatype is used to identify different connection over a + * single interface (like RMAP or I2C) + * @details + * To use this class, implement a communication specific child cookie which + * inherits Cookie. Cookie instances are created in config/Factory.cpp by + * calling @code{.cpp} CookieIF* childCookie = new ChildCookie(...) + * @endcode . + * + * This cookie is then passed to the child device handlers, which stores the + * pointer and passes it to the communication interface functions. + * + * The cookie can be used to store all kinds of information + * about the communication, like slave addresses, communication status, + * communication parameters etc. + * + * @ingroup comm + */ +class CookieIF { +public: + virtual ~CookieIF() {}; +}; + +#endif /* COOKIE_H_ */