Commit 99ac6b0e authored by rmrf's avatar rmrf
Browse files

More cleanup.

parent 909ef405
......@@ -3,42 +3,40 @@
using namespace scpar;
using namespace std;
EventContainer::~EventContainer ()
{
// Do not delete the _astNode.
EventContainer::~EventContainer() {
// Do not delete the ast_node_.
// Clang should take care of that.
}
EventContainer::EventContainer ():_eventName ("NONE"), _astNode (NULL)
{
EventContainer::EventContainer():
event_name_{"NONE"},
ast_node_{nullptr} {
}
EventContainer::EventContainer (string pname, VarDecl * e):_eventName (pname),
_astNode (e)
{
EventContainer::EventContainer( string pname, VarDecl * e ) :
event_name_{pname},
ast_node_{e} {
}
EventContainer::EventContainer (const EventContainer & from
)
{
_eventName = from._eventName;
_astNode = from._astNode;
EventContainer::EventContainer( const EventContainer & from ) {
event_name_ = from.event_name_;
ast_node_ = from.ast_node_;
}
string EventContainer::getEventName() const {
return event_name_;
}
string EventContainer::getEventName ()
{
return _eventName;
VarDecl * EventContainer::getASTNode() const {
return ast_node_;
}
void
EventContainer::dump (raw_ostream & os, int tabn
)
{
for (int i = 0; i < tabn; i++)
void EventContainer::dump( llvm::raw_ostream & os, int tabn ) {
for (int i = 0; i < tabn; i++) {
os << " ";
}
os << " EventContainer '" << _eventName << "'\n";
os << " EventContainer '" << event_name_ << "'\n";
}
......@@ -25,31 +25,23 @@ namespace scpar {
class EventContainer {
public:
EventContainer (
);
EventContainer (string, VarDecl *
);
EventContainer();
EventContainer( string, VarDecl * );
~EventContainer (
);
~EventContainer();
// Copy constructor.
EventContainer (const EventContainer &
);
EventContainer( const EventContainer & );
string getEventName (
);
string getEventName() const;
VarDecl *getASTNode() const;
VarDecl *getASTNode (
);
void dump (raw_ostream & os, int tabn = 0);
void dump ( llvm::raw_ostream & os, int tabn = 0 );
private:
// Name of port on which the binding happens.
string _eventName;
VarDecl *_astNode;
string event_name_;
VarDecl *ast_node_;
};
}
#endif
......@@ -5,68 +5,48 @@
using namespace scpar;
using namespace std;
EventDecl::~EventDecl ()
{
EventDecl::~EventDecl() {
// _astNode does *NOT* need to be deleted because clang should
// be responsible for freeing the memory.
}
EventDecl::EventDecl ():
_name ("NONE"), _astNode (NULL)
{
EventDecl::EventDecl() :
_name{"NONE"},
_astNode{nullptr} {
}
EventDecl::EventDecl (const string & name, FieldDecl * fd
):
_name (name
),
_astNode (fd
)
{
EventDecl::EventDecl( const string & name, FieldDecl * fd ) :
_name{name},
_astNode{fd} {
}
EventDecl::EventDecl (const EventDecl & from
)
{
EventDecl::EventDecl( const EventDecl & from ) {
_name = from._name;
_astNode = from._astNode;
}
void
EventDecl::ptrCheck (
)
{
assert (!(_astNode == NULL));
void EventDecl::ptrCheck() {
assert( _astNode != nullptr );
}
string EventDecl::getName ()
{
string EventDecl::getName() {
return _name;
}
FieldDecl *
EventDecl::getASTNode (
)
{
ptrCheck ();
FieldDecl *EventDecl::getASTNode() {
ptrCheck();
return _astNode;
}
void
EventDecl::dump (raw_ostream & os, int tabn
)
{
ptrCheck ();
Utility
u;
void EventDecl::dump( llvm::raw_ostream & os, int tabn ) {
ptrCheck();
Utility u;
u.tabit (os, tabn);
//for (int i=0; i < tabn; i++) {
// os << " ";
// }
os << "EventDecl " << this << " '" << _name << "' FieldDecl " <<
getASTNode ();
os << "EventDecl " << this << " '" << _name << "' FieldDecl "
<< getASTNode();
}
......@@ -13,36 +13,30 @@ namespace scpar {
class EventDecl {
public:
// Typedefs.
typedef pair < string, FieldDecl * >eventPairType;
typedef map < string, FieldDecl * >eventMapType;
// typedef pair < string, FieldDecl * >eventPairType;
// typedef map < string, FieldDecl * >eventMapType;
// Constructors.
EventDecl (
);
EventDecl (const string &, FieldDecl *
);
EventDecl();
EventDecl( const string &, FieldDecl * );
// Copy constructor.
EventDecl (const EventDecl &
);
EventDecl( const EventDecl & );
// Destructor.
~EventDecl (
);
~EventDecl();
/// Get parameters
string getName (
);
FieldDecl *getASTNode (
);
string getName();
FieldDecl *getASTNode();
// Print
void dump (raw_ostream &, int tabn = 0);
private:
void ptrCheck (
);
void ptrCheck();
private:
string _name;
string _name;
FieldDecl *_astNode;
};
}
......
......@@ -13,12 +13,12 @@ NotifyCalls::NotifyCalls() :
name_{"NONE"} {
}
NotifyCalls::NotifyCalls(const string & name, FindNotify::NotifyCallListType notify_list ) :
NotifyCalls::NotifyCalls(const string &name, FindNotify::NotifyCallListType notify_list ) :
name_{name},
notify_call_list_{notify_list} {
}
NotifyCalls::NotifyCalls( const NotifyCalls & from ) {
NotifyCalls::NotifyCalls( const NotifyCalls &from ) {
name_ = from.name_;
notify_call_list_ = from.notify_call_list_;
}
......@@ -35,7 +35,7 @@ unsigned int NotifyCalls::getNumNotifyCalls() {
return notify_call_list_.size();
}
void NotifyCalls::dump ( llvm::raw_ostream & os, int tabn ) {
void NotifyCalls::dump( llvm::raw_ostream &os, int tabn ) {
for ( size_t i{0}; i < notify_call_list_.size(); ++i ) {
os << "\n Notify Call: " << notify_call_list_.at(i);
}
......
......@@ -31,7 +31,7 @@ namespace scpar {
NotifyCalls( const string &, FindNotify::NotifyCallListType );
// Copy constructor.
NotifyCalls (const NotifyCalls & );
NotifyCalls( const NotifyCalls & );
// Destructor.
~NotifyCalls();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment