Skip to content

Hackathon 13th July 2018

Michael Frey edited this page Jul 10, 2018 · 24 revisions

Agenda

  • Unit tests in CCN-lite
  • Data structures

Participants

  • Cenk Gündogan (HAW)
  • Michael Frey (MSA Safety)

Topics

Unit tests in CCN-lite

The goal is to have CMocka ready for CCN-lite. Tests (and mocks) should be in a directory test/ in the project root and integrated in the CMake-based build process. I've started a branch (latest changes need to be committed) over here.

Data structures

We want to start to refactor the interface for accessing various data structures across CCN-lite. One good starting point might be the content store. There is already a ticket which discusses some ideas, such as callbacks and a unified interface for accessing the content store (and hence allow to provide different implementations).

We should also think about making things const wherever it is possible. The content store will never alter prefix nor the content so there is no need to make them non-const.

Ideas

NDN-CPP

I've thought it might be a good idea to look how NDN does it. The Data API is a good starting point.

API
/** 
  * @brief Returns the size of the content store
  */
uint32_t size();

/** 
  * @brief Adds content to the content store
  *
  * @return 0, if the operation was successful
  * @return -1, if the content could not be added to the content store (no space?)
  * @return -2, if the content is already in the content store
  */
int8_t add(struct ccnl_prefix_s prefix, struct ccnl_content_s content);

/** 
  * @brief Returns the content of a given @p prefix
  *
  * @return Upon success the content object associated with the given 
  *   prefix, NULL otherwise
  */
struct ccnl_content_s* get(struct ccnl_prefix_s prefix);

/** 
  * @brief Removes all entries from the content store
  */
void clear();

/** 
  * @brief Checks if content under the given @p prefix is already stored
  *  in the content store.
  * 
  * @note Does it make sense?
  */
bool has_prefix(struct ccnl_prefix_s *prefix);

/** 
  * @brief Removes the content associated with the given @p prefix from
  *  the content store.
  * 
  * @note Should the removed content be returned?
  */
void remove(struct ccnl_prefix_s *prefix);
Clone this wiki locally