Commit f3c8ce08 authored by Jiachen,Chen's avatar Jiachen,Chen

Added TestDebug

parent 7f0d4b6a
/*
* File: TestDebug.cc
* Author: Jiachen Chen
*
* Created on April 30, 2019, 2:42 AM
*/
#include "TestDebug.hh"
CLICK_DECLS
#define TEST_DEBUG
#ifdef TEST_DEBUG
#define DEBUG(...) _DEBUG(__VA_ARGS__, "dummy")
#define _DEBUG(fmt, ...) printf("[%s():%d] " fmt "%.0s\n", \
__func__, __LINE__, __VA_ARGS__)
#else
#define DEBUG(...)
#endif
TestDebug::TestDebug() = default;
TestDebug::~TestDebug() = default;
int TestDebug::initialize(ErrorHandler* errh __attribute ((__unused__))) {
DEBUG("You can only see me when TEST_DEBUG is defined!");
DEBUG("You can use this function just as print: %p", this);
return 0;
}
CLICK_ENDDECLS
EXPORT_ELEMENT(TestDebug)
\ No newline at end of file
require(package "click_for_comnet");
test :: TestDebug;
DriverManager(stop);
/*
* File: TestDebug.hh
* Author: Jiachen Chen
*
* Created on April 30, 2019, 2:42 AM
*/
#ifndef TESTDEBUG_HH
#define TESTDEBUG_HH
#include <click/config.h>
#include <click/element.hh>
#include <click/error.hh>
CLICK_DECLS
class TestDebug : public Element {
public:
TestDebug();
~TestDebug();
const char *class_name() const { return "TestDebug"; }
int initialize(ErrorHandler *errh);
private:
};
CLICK_ENDDECLS
#endif /* TESTDEBUG_HH */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment