Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Attributes | List of all members
SVF::GenericGraphReader< NodeTy, EdgeTy > Class Template Reference

#include <SVFFileSystem.h>

Inheritance diagram for SVF::GenericGraphReader< NodeTy, EdgeTy >:
SVF::ICFGReader

Public Member Functions

template<typename NodeCreator , typename EdgeCreator >
void createObjs (const cJSON *graphJson, NodeCreator nodeCreator, EdgeCreator edgeCreator)
 
NodeTygetNodePtr (unsigned id) const
 
EdgeTygetEdgePtr (unsigned id) const
 
template<typename NodeFiller , typename EdgeFiller >
void fillObjs (NodeFiller nodeFiller, EdgeFiller edgeFiller)
 
void saveToGenericGraph (GenericGraph< NodeTy, EdgeTy > *graph) const
 
const cJSONgetFieldJson () const
 

Protected Attributes

const cJSONgraphFieldJson = nullptr
 

Private Attributes

ReaderIDToObjMap< NodeTyidToNodeMap
 
ReaderPtrPool< EdgeTyedgePool
 

Detailed Description

template<typename NodeTy, typename EdgeTy>
class SVF::GenericGraphReader< NodeTy, EdgeTy >

Definition at line 819 of file SVFFileSystem.h.

Member Function Documentation

◆ createObjs()

void SVF::GenericGraphReader< NodeTy, EdgeTy >::createObjs ( const cJSON graphJson,
NodeCreator  nodeCreator,
EdgeCreator  edgeCreator 
)
inline

Definition at line 830 of file SVFFileSystem.h.

832 {
833 // Read nodeNum
834 const cJSON* nodeNum = graphJson->child;
835 CHECK_JSON_KEY(nodeNum);
836 u32_t numOfNodes = jsonGetNumber(nodeNum);
837 (void)numOfNodes;
838
839 // Read allNode
840 const cJSON* allNode = nodeNum->next;
843 // TODO: ABORT_IFNOT(idToNodeMap.size() == numOfNodes, "nodeNum mismatch");
844
845 // Read edgeNum
846 const cJSON* edgeNum = allNode->next;
847 CHECK_JSON_KEY(edgeNum);
848 u32_t numOfEdges = jsonGetNumber(edgeNum);
849 (void)numOfEdges;
850
851 // Read allEdge
852 const cJSON* allEdge = edgeNum->next;
855 // TODO: ABORT_IFNOT(edgePool.size() == numOfEdges, "edgeNum mismatch");
856
857 // Rest fields
858 assert(!graphFieldJson && "graphFieldJson should be empty");
860 }
unsigned u32_t
Definition CommandLine.h:18
#define CHECK_JSON_KEY(obj)
const cJSON * graphFieldJson
ReaderIDToObjMap< NodeTy > idToNodeMap
ReaderPtrPool< EdgeTy > edgePool
void createObjs(const cJSON *idObjArrayJson, IdObjCreator idObjCreator)
idObjcreator : (const cJSON*) -> (id, T*) with id set
void createObjs(const cJSON *objArrayJson, Creator creator)
double jsonGetNumber(const cJSON *item)
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74
Definition cJSON.h:104
struct cJSON * child
Definition cJSON.h:109
struct cJSON * next
Definition cJSON.h:106

◆ fillObjs()

void SVF::GenericGraphReader< NodeTy, EdgeTy >::fillObjs ( NodeFiller  nodeFiller,
EdgeFiller  edgeFiller 
)
inline

Definition at line 873 of file SVFFileSystem.h.

874 {
875 // GenericNode<> contains field `InEdges` and `OutEdges`, which are
876 // ordered set of edges with comparator `GenericEdge::equalGEdge()`,
877 // which need operands `src` and `dst` to be non-null to get IDs, so we
878 // need to fill nodes first.
881 }
void fillObjs(FillFunc fillFunc)
void fillObjs(FillFunc fillFunc)

◆ getEdgePtr()

EdgeTy * SVF::GenericGraphReader< NodeTy, EdgeTy >::getEdgePtr ( unsigned  id) const
inline

Definition at line 867 of file SVFFileSystem.h.

868 {
869 return edgePool.getPtr(id);
870 }
T * getPtr(size_t id) const

◆ getFieldJson()

const cJSON * SVF::GenericGraphReader< NodeTy, EdgeTy >::getFieldJson ( ) const
inline

Definition at line 890 of file SVFFileSystem.h.

891 {
892 return graphFieldJson;
893 }

◆ getNodePtr()

NodeTy * SVF::GenericGraphReader< NodeTy, EdgeTy >::getNodePtr ( unsigned  id) const
inline

Definition at line 862 of file SVFFileSystem.h.

863 {
864 return idToNodeMap.getPtr(id);
865 }
T * getPtr(unsigned id) const

◆ saveToGenericGraph()

void SVF::GenericGraphReader< NodeTy, EdgeTy >::saveToGenericGraph ( GenericGraph< NodeTy, EdgeTy > *  graph) const
inline

Definition at line 883 of file SVFFileSystem.h.

884 {
885 graph->edgeNum = edgePool.size();
886 graph->nodeNum = idToNodeMap.size();
887 idToNodeMap.saveToIDToObjMap(graph->IDToNodeMap);
888 }
void saveToIDToObjMap(Map &idToObjMap) const
size_t size() const

Member Data Documentation

◆ edgePool

Definition at line 823 of file SVFFileSystem.h.

◆ graphFieldJson

const cJSON* SVF::GenericGraphReader< NodeTy, EdgeTy >::graphFieldJson = nullptr
protected

Definition at line 826 of file SVFFileSystem.h.

◆ idToNodeMap

Definition at line 822 of file SVFFileSystem.h.


The documentation for this class was generated from the following files: