ICG 2
Electric Boogaloo
DataTypeAlgorithm.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "FindLeaves.hpp"
4 #include "ContainsPointer.hpp"
7 #include "ContainsPointer.hpp"
8 #include "PrintValue.hpp"
9 #include "AssignValue.hpp"
10 #include "GetValue.hpp"
11 #include "ClearValue.hpp"
12 #include "ResizeSequence.hpp"
13 
14 namespace DataTypeAlgorithm {
15 
22  ContainsPointer::Result containsPointer(std::shared_ptr<const DataType> node);
23 
32  FindLeaves::Result findLeaves(std::shared_ptr<const DataType> node, std::string starting_name, void * starting_address);
33 
34 
43  LookupAddressAndTypeByName::Result lookupAddressAndTypeByName (std::shared_ptr<const DataType> node, void * starting_address, std::string full_name);
44 
53  LookupAddressAndTypeByName::Result lookupAddressAndTypeByName (std::shared_ptr<const DataType> node, void * starting_address, MutableVariableName name_elems);
54 
65  LookupNameByAddressAndType::Result lookupNameByAddressAndType (std::shared_ptr<const DataType> node, std::string starting_name, void * starting_address, void * lookup_address, std::shared_ptr<const DataType> const search_type);
66 
74  void printValue(std::shared_ptr<const DataType> node, std::ostream& s, void * address);
75 
84  AssignValue::Result assignValue(std::shared_ptr<const DataType> node, Value * val, void * address);
85 
93  GetValue::Result getValue(std::shared_ptr<const DataType> node, void * address);
94 
101  void clearValue(std::shared_ptr<const DataType> node, void * address);
102 
110  bool resizeSequence(std::shared_ptr<const DataType> node, void * address, int num_elems);
111 }
Definition: MutableVariableName.hpp:9
Value is an abstract base-class that represents a value on the right-hand-side of an assignment.
Definition: Value.hpp:9
bool Result
Definition: AssignValue.hpp:13
bool Result
Definition: ContainsPointer.hpp:8
Definition: DataTypeAlgorithm.hpp:14
bool resizeSequence(std::shared_ptr< const DataType > node, void *address, int num_elems)
Resize a sequence to the given size.
Definition: DataTypeAlgorithm.cpp:119
LookupNameByAddressAndType::Result lookupNameByAddressAndType(std::shared_ptr< const DataType > node, std::string starting_name, void *starting_address, void *lookup_address, std::shared_ptr< const DataType > const search_type)
Traverse the allocation of the given type to get the name of nested member that starts at the given a...
Definition: DataTypeAlgorithm.cpp:66
void printValue(std::shared_ptr< const DataType > node, std::ostream &s, void *address)
Print an ascii representation of the value starting at the given address of the given type to the giv...
Definition: DataTypeAlgorithm.cpp:88
ContainsPointer::Result containsPointer(std::shared_ptr< const DataType > node)
Determine whether or not this type is a pointer, or has any pointer members or subtypes.
Definition: DataTypeAlgorithm.cpp:18
FindLeaves::Result findLeaves(std::shared_ptr< const DataType > node, std::string starting_name, void *starting_address)
Find all of the leaves in this allocation as name-value pairs.
Definition: DataTypeAlgorithm.cpp:25
LookupAddressAndTypeByName::Result lookupAddressAndTypeByName(std::shared_ptr< const DataType > node, void *starting_address, std::string full_name)
Search in the allocation of the given type for a nested member with the correct name....
Definition: DataTypeAlgorithm.cpp:52
GetValue::Result getValue(std::shared_ptr< const DataType > node, void *address)
Get the value of a leaf type (string, pointer, primitive, enum)
Definition: DataTypeAlgorithm.cpp:102
void clearValue(std::shared_ptr< const DataType > node, void *address)
Clear the contents of an instance of a type.
Definition: DataTypeAlgorithm.cpp:111
AssignValue::Result assignValue(std::shared_ptr< const DataType > node, Value *val, void *address)
Assign the value of a leaf type (string, pointer, primitive, enum)
Definition: DataTypeAlgorithm.cpp:95
std::vector< Leaf > Result
Definition: FindLeaves.hpp:27
Definition: LookupAddressAndTypeByName.hpp:13
Definition: LookupNameByAddressAndType.hpp:9