Skip to content

Commit

Permalink
Add common/Annotatable.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent af81224 commit 34a82a3
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 6 deletions.
6 changes: 0 additions & 6 deletions common/h/Annotatable.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ class COMMON_EXPORT AnnotatableDense
{
typedef void *anno_list_t;

/**
* Inheriting from this class adds a pointer to each object. Multiple
* types of annotations are stored under this pointer in a
* annotation_type -> anno_list_t map.
**/

private:

typedef anno_list_t anno_map_t;
Expand Down
66 changes: 66 additions & 0 deletions docs/common/developer/Annotatable.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,69 @@
Annotatable.h
#############

.. cpp:namespace:: Dyninst

.. cpp:function:: bool annotation_debug_flag()

.. cpp:type:: unsigned short AnnotationClassID
.. cpp:type:: bool (*anno_cmp_func_t)(void *, void*)

.. cpp:class:: AnnotationClassBase

.. cpp:function:: protected AnnotationClassBase(std::string n, anno_cmp_func_t cmp_func_ = NULL)
.. cpp:function:: protected virtual ~AnnotationClassBase()
.. cpp:function:: static AnnotationClassBase *findAnnotationClass(unsigned int id)
.. cpp:function:: static void dumpAnnotationClasses()
.. cpp:function:: AnnotationClassID getID()
.. cpp:function:: std::string &getName()
.. cpp:function:: anno_cmp_func_t getCmpFunc()
.. cpp:function:: virtual const char *getTypeName() = 0
.. cpp:function:: virtual void *allocate() = 0

.. cpp:class:: template <class T> AnnotationClass : public AnnotationClassBase

.. cpp:function:: AnnotationClass(std::string n, anno_cmp_func_t cmp_func_ = NULL)
.. cpp:function:: const char *getTypeName()
.. cpp:function:: void *allocate()
.. cpp:function:: size_t size()

.. cpp:enum:: sparse_or_dense_anno_t

.. cpp:enumerator:: sparse
.. cpp:enumerator:: dense

.. cpp:struct:: ser_rec_t

.. cpp:member:: AnnotationClassBase *acb
.. cpp:member:: void *data
.. cpp:member:: void *parent_id
.. cpp:member:: sparse_or_dense_anno_t sod

.. cpp:enum:: ser_post_op_t

.. cpp:enumerator:: sp_add_anno
.. cpp:enumerator:: sp_rem_anno
.. cpp:enumerator:: sp_add_cont_item
.. cpp:enumerator:: sp_rem_cont_item

.. cpp:function:: const char *serPostOp2Str(ser_post_op_t)

.. cpp:class:: AnnotatableDense

Inheriting from this class adds a pointer to each object. Multiple
types of annotations are stored under this pointer in a
annotation_type -> anno_list_t map.

.. cpp:function:: template<class T> bool addAnnotation(const T *a, AnnotationClass<T> &a_id)
.. cpp:function:: AnnotatableDense(const AnnotatableDense&) = default
.. cpp:function:: AnnotatableDense()
.. cpp:function:: template<class T> inline bool getAnnotation(T *&a, AnnotationClass<T> &a_id) const
.. cpp:function:: template<class T> inline bool removeAnnotation(AnnotationClass<T> &a_id)
.. cpp:function:: void annotationsReport()

.. cpp:class:: AnnotatableSparse

.. cpp:type:: dyn_hash_map<void *, void *, void_ptr_hasher> annos_by_type_t
.. cpp:type:: std::vector<annos_by_type_t *> annos_t
.. cpp:function:: AnnotatableSparse() = default
.. cpp:function:: AnnotatableSparse(const AnnotatableSparse&) = default

0 comments on commit 34a82a3

Please sign in to comment.