From 1310f2387c3fb9feb0a50119f08c117c90cd41d2 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Wed, 9 Mar 2011 15:10:05 -0600 Subject: [PATCH] Changing BroDocObj wrapper class to wrap ID instead of BroObj. --- src/BroDocObj.cc | 11 ++++------- src/BroDocObj.h | 31 +++++++++++++------------------ 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/BroDocObj.cc b/src/BroDocObj.cc index 645c4f1475..2ff5d88f5e 100644 --- a/src/BroDocObj.cc +++ b/src/BroDocObj.cc @@ -1,15 +1,12 @@ #include #include #include -#include "Obj.h" +#include "ID.h" #include "BroDocObj.h" -BroDocObj::BroDocObj(const BroObj* obj, - std::list*& reST, - bool exported) +BroDocObj::BroDocObj(const ID* id, std::list*& reST) { - broObj = obj; - isExported = exported; + broID = id; reST_doc_strings = reST; reST = 0; } @@ -30,6 +27,6 @@ void BroDocObj::WriteReST(FILE* file) const } ODesc desc; - broObj->Describe(&desc); + broID->DescribeExtended(&desc); fprintf(file, "%s\n", desc.Description()); } diff --git a/src/BroDocObj.h b/src/BroDocObj.h index 42bfc8882f..0fdbcca8a5 100644 --- a/src/BroDocObj.h +++ b/src/BroDocObj.h @@ -5,19 +5,18 @@ #include #include -#include "Obj.h" +#include "ID.h" class BroDocObj { public: /** * BroDocObj constructor - * @param obj a pointer to a BroObj that is to be documented + * @param id a pointer to an identifier that is to be documented * @param reST a reference to a pointer of a list of strings that - represent the reST documentation for the BroObj. The pointer + represent the reST documentation for the ID. The pointer will be set to 0 after this constructor finishes. - * @param exported whether the BroObj is declared in an export section */ - BroDocObj(const BroObj* obj, std::list*& reST, bool exported); + BroDocObj(const ID* id, std::list*& reST); /** * BroDocObj destructor @@ -36,35 +35,31 @@ public: * the reST as written into new reST before being written out. * This allows for additional custom markup or macros when writing * pure reST might be inconvenient. - * 2) a reST friendly description of the BroObj - * Could be implemented similar to the virtual BroObj::Describe(ODesc) - * E.g. all subclasses will now need to implement a reSTDescribe(ODesc) - * so that they can describe themselves in terms of the custom reST - * directives/roles that we'll later teach to Sphinx via a "bro domain". - * ID's should be able to implement the reSTDescribe(ODesc) function - * such that their namespace and attributes are output as well. + * 2) a reST friendly description of the ID + * Could be implemented similar to the ID::DescribeExtended(ODesc) + * expect with new directives/roles that we'll later teach to Sphinx + * via a "bro domain". * @param The (already opened) file to write the reST to. */ void WriteReST(FILE* file) const; /** * Check whether this documentation is part of the public API - * (The BroObj declaration was while in an export section). - * @return true if the BroObj was declared in an export section, else false + * (The declaration was while in an export section). + * @return true if the ID was declared in an export section, else false */ - bool IsPublicAPI() const { return isExported; } + bool IsPublicAPI() const { return broID->IsExport(); } /** * Return whether this object has documentation (## comments) - * @return true if the BroObj has comments associated with it + * @return true if the ID has comments associated with it */ bool HasDocumentation() const { return reST_doc_strings && reST_doc_strings->size() > 0; } protected: std::list* reST_doc_strings; - const BroObj* broObj; - bool isExported; + const ID* broID; private: };