Open SSoelvsten opened 1 year ago
Hey @SSoelvsten do you mean test/test.cpp ? . Also the paths that you have mentioned do not exist . Can you specify the entire path
The paths are based on the major refactor in #397 where lots of stuff has been moved around (and also, I mistakenly wrote the C include path rather than the project path; I fixed them now to be relative to the root of the repo, but I apologize for the confusion).
If you are interested in contributing, your contribution should build on-top of and be pull requested for the internal-cleanup branch, not main.
I would like to help here @SSoelvsten . I am a beginner so,can you tell me what to by giving a single example, so it will be clear for me as in how to proceed . Thank you
The following is a minimal example of how one creates a to_string
method and a <<
overload for a custom type (class) in C++
class A
{
private:
int a1;
int a2;
public:
A(int arg_1, int arg_2)
: a1(arg_1), a2(arg_2)
{ }
public:
std::string to_string() const
{
std::stringstream ss;
ss << "A(" << a1 << "," << a2 << ")";
return ss.str();
}
};
std::ostream& operator<< (std::ostream& os, const A &a)
{ return os << a.to_string(); }
In test/test.h we have several stringizer functions that create pretty-printed version of the basic data types. These ought to be moved over into the respective classes in src/ such that they can be used in other ways, e.g. debugging and exceptions.
For each data type we ought to
<<
operator overloading that gets and returns astd::ostream&
.to_string()
method that returns thestd::string
constructed with astd::stringstream
.Data Types
ptr_uint64
in src/adiar/internal/data_types/ptr.h__uid<ptr_t>
in src/adiar/internal/data_types/uid.hnode
in src/adiar/internal/data_types/node.harc
in src/adiar/internal/data_types/arc.hlevel_info
in src/adiar/internal/data_types/level_info.hassignment
in src/adiar/assignment.h