Skip to content
Permalink
Browse files

Renamed IList -> List

  • Loading branch information
nfomon committed May 25, 2015
1 parent d69fa55 commit cd4299d67f9c2102762316f5d47275d45586def5
@@ -10,8 +10,8 @@

#include "statik/Grapher.h"
#include "statik/Hotlist.h"
#include "statik/IList.h"
#include "statik/IncParser.h"
#include "statik/List.h"
#include "statik/Rule.h"
#include "statik/SError.h"
#include "statik/SLog.h"
@@ -85,8 +85,8 @@ int main(int argc, char *argv[]) {
parsers.push_back(new IncParser(*i, i->Name(), graphdir));
}

IList* start = NULL;
IList* prev = NULL;
List* start = NULL;
List* prev = NULL;
string line;
while (getline(cin, line)) {
//line += "\n";
@@ -100,7 +100,7 @@ int main(int argc, char *argv[]) {
delnum *= 10;
delnum += line[2] - '0';
}
IList* s = start;
List* s = start;
if (!s) {
throw SError("Cannot delete entry without start");
}
@@ -137,7 +137,7 @@ int main(int argc, char *argv[]) {
continue;
}
for (size_t i=0; i < line.size(); ++i) {
IList* c = new IList("", string(1, line.at(i)));
List* c = new List("", string(1, line.at(i)));
if (!start) { start = c; }
if (prev) {
prev->right = c;
@@ -162,9 +162,9 @@ int main(int argc, char *argv[]) {
}
}
g_log.info() << "Clearing input";
IList* i = start;
List* i = start;
while (i) {
IList* j = i->right;
List* j = i->right;
delete i;
i = j;
}
@@ -200,7 +200,7 @@ WindowResponse LineBuf::Insert(int y, int x, int ch) {
next->SetPrevious(c);
c->SetNext(next);
}
statik::IList* istart = &c->inode;
statik::List* istart = &c->inode;
while (istart->left) {
istart = istart->left;
}
@@ -7,7 +7,7 @@
#include "ISError.h"
#include "WindowResponse.h"

#include "statik/IList.h"
#include "statik/List.h"
#include "statik/ObjectPool.h"

#include <boost/ptr_container/ptr_vector.hpp>
@@ -25,7 +25,7 @@ struct Char {
operator std::string() const;

int ch;
statik::IList inode;
statik::List inode;
};
std::ostream& operator<< (std::ostream& out, const Char& node);

@@ -5,6 +5,8 @@

#include "ISError.h"

#include "statik/List.h"

#include <string>
#include <iostream>
using std::endl;
@@ -27,7 +29,7 @@ WindowResponse ParserWindow::Input(const statik::Hotlist& ihotlist) {
m_incParser.ExtractHotlist(hotlist);
g_log.info() << "Printing WindowResponse list. Hotlist size is: " << hotlist.Size();
if (!hotlist.IsEmpty()) {
const statik::IList* inode = m_incParser.GetFirstONode();
const statik::List* inode = m_incParser.GetFirstONode();
string old_str = m_str;
m_str = "";
bool first = true;
@@ -4,20 +4,18 @@
#ifndef _statik_ComputeFunc_h_
#define _statik_ComputeFunc_h_

#include "List.h"
#include "ParseAction.h"

#include <memory>

namespace statik {

class IList;
class STree;

struct ComputeFunc {
public:
virtual ~ComputeFunc() {}
void Init(STree& x) { m_node = &x; }
virtual void operator() (ParseAction::Action action, const IList& inode, const STree* initiator) = 0;
virtual void operator() (ParseAction::Action action, const List& inode, const STree* initiator) = 0;
virtual std::auto_ptr<ComputeFunc> Clone() = 0;
protected:
STree* m_node;
@@ -3,7 +3,7 @@

#include "Grapher.h"

#include "IList.h"
#include "List.h"
#include "Rule.h"
#include "SError.h"
#include "SLog.h"
@@ -43,7 +43,7 @@ void Grapher::AddMachine(const string& context, const Rule& machineRoot) {
m_isDirty = true;
}

void Grapher::AddOrderList(const string& context, const OrderList& orderList, const IList& start) {
void Grapher::AddOrderList(const string& context, const OrderList& orderList, const List& start) {
m_graph += "subgraph cluster_" + dotVar(&orderList, context) + " {\n";
m_graph += "node [shape=box];\n";
m_graph += "graph [style=\"filled\", fillcolor=\"#f0e0d0\"];\n";
@@ -52,7 +52,7 @@ void Grapher::AddOrderList(const string& context, const OrderList& orderList, co
m_isDirty = true;
}

void Grapher::AddIList(const string& context, const IList& inode, const string& label) {
void Grapher::AddIList(const string& context, const List& inode, const string& label) {
m_graph += "subgraph cluster_" + context + dotVar(&inode, context) + " {\n";
if (!label.empty()) {
m_graph += "label=\"" + label + "\";\n";
@@ -74,7 +74,7 @@ void Grapher::AddSTree(const string& context, const STree& snode, const string&
m_isDirty = true;
}

void Grapher::AddOList(const string& context, const IList& onode, const string& label) {
void Grapher::AddOList(const string& context, const List& onode, const string& label) {
m_graph += "subgraph cluster_" + context + dotVar(&onode, context) + " {\n";
if (!label.empty()) {
m_graph += "label=\"" + label + "\";\n";
@@ -85,7 +85,7 @@ void Grapher::AddOList(const string& context, const IList& onode, const string&
m_isDirty = true;
}

void Grapher::AddIListeners(const string& context, const IncParser& incParser, const IList& inode) {
void Grapher::AddIListeners(const string& context, const IncParser& incParser, const List& inode) {
IncParser::listener_set ls = incParser.GetListeners(inode);
for (IncParser::listener_iter i = ls.begin(); i != ls.end(); ++i) {
m_graph += dotVar(&inode, context) + " -> " + dotVar(*i, context) + " [constraint=false, weight=0, style=dashed, arrowsize=0.5, color=\"#3333cc\"];\n";
@@ -4,8 +4,8 @@
#ifndef _statik_Grapher_h_
#define _statik_Grapher_h_

#include "IList.h"
#include "IncParser.h"
#include "List.h"
#include "Rule.h"
#include "STree.h"

@@ -18,11 +18,11 @@ class Grapher {
Grapher(const std::string& out_dir, const std::string& base_filename);

void AddMachine(const std::string& context, const Rule& machineRoot);
void AddOrderList(const std::string& context, const OrderList& orderList, const IList& start);
void AddIList(const std::string& context, const IList& start, const std::string& label = "");
void AddOrderList(const std::string& context, const OrderList& orderList, const List& start);
void AddIList(const std::string& context, const List& start, const std::string& label = "");
void AddSTree(const std::string& context, const STree& root, const std::string& label = "", const STree* initiator = NULL);
void AddOList(const std::string& context, const IList& start, const std::string& label = "");
void AddIListeners(const std::string& context, const IncParser& incParser, const IList& start);
void AddOList(const std::string& context, const List& start, const std::string& label = "");
void AddIListeners(const std::string& context, const IncParser& incParser, const List& start);
void AddHotlist(const std::string& context, const Hotlist::hotlist_vec& hotlist);
void Signal(const std::string& context, const void*, bool isUpdate = false);

@@ -3,7 +3,7 @@

#include "Hotlist.h"

#include "IList.h"
#include "List.h"
#include "SLog.h"

#include <string>
@@ -20,17 +20,17 @@ std::string Hotlist::UnMapHotOp(const HOT_OP& hotop) {
}
}

void Hotlist::Insert(const IList& inode) {
void Hotlist::Insert(const List& inode) {
m_hotlist.push_back(std::make_pair(&inode, OP_INSERT));
m_inserted.insert(&inode);
}

void Hotlist::Delete(const IList& inode) {
void Hotlist::Delete(const List& inode) {
m_hotlist.push_back(std::make_pair(&inode, OP_DELETE));
m_deleted.insert(&inode);
}

void Hotlist::Update(const IList& inode) {
void Hotlist::Update(const List& inode) {
m_hotlist.push_back(std::make_pair(&inode, OP_UPDATE));
}

@@ -4,19 +4,19 @@
#ifndef _statik_Hotlist_h_
#define _statik_Hotlist_h_

/* A set of IList nodes that are "hot", meaning their done-ness has changed.
/* A set of List nodes that are "hot", meaning their done-ness has changed.
* They can be Insert()ed or Delete()d on the next IncParser.
*/

#include "List.h"

#include <set>
#include <string>
#include <utility>
#include <vector>

namespace statik {

struct IList;

class Hotlist {
public:
enum HOT_OP {
@@ -27,10 +27,10 @@ class Hotlist {

static std::string UnMapHotOp(const HOT_OP& hotop);

typedef std::pair<const IList*, HOT_OP> hotpair;
typedef std::pair<const List*, HOT_OP> hotpair;
typedef std::vector<hotpair> hotlist_vec;
typedef hotlist_vec::const_iterator hotlist_iter;
typedef std::set<const IList*> hot_set;
typedef std::set<const List*> hot_set;
typedef hot_set::const_iterator hotset_iter;

const hotlist_vec& GetHotlist() const { return m_hotlist; }
@@ -39,9 +39,9 @@ class Hotlist {
size_t Size() const { return m_hotlist.size(); }
bool IsEmpty() const { return m_hotlist.empty(); }

void Insert(const IList& inode);
void Update(const IList& inode);
void Delete(const IList& inode);
void Insert(const List& inode);
void Update(const List& inode);
void Delete(const List& inode);
void Accept(const hotlist_vec& hotlist);
void Clear();

@@ -21,29 +21,29 @@ bool IConnection::IsClear() const {
return !m_istart;
}

const IList& IConnection::Start() const {
const List& IConnection::Start() const {
if (!m_istart) {
throw SError("Cannot get start of uninitialized IConnection");
}
return *m_istart;
}

const IList& IConnection::End() const {
const List& IConnection::End() const {
if (!m_iend) {
throw SError("Cannot get end of uninitialized IConnection");
}
return *m_iend;
}

void IConnection::Restart(const IList& istart, bool total) {
void IConnection::Restart(const List& istart, bool total) {
g_log.debug() << "Restarting node to " << istart;
m_istart = &istart;
if (total) {
m_iend = &istart;
}
}

void IConnection::SetEnd(const IList& iend) {
void IConnection::SetEnd(const List& iend) {
if (!m_istart) {
throw SError("Cannot set end of IConnection that has not been started");
}
@@ -4,7 +4,7 @@
#ifndef _statik_IConnection_h_
#define _statik_IConnection_h_

#include "IList.h"
#include "List.h"

namespace statik {

@@ -15,15 +15,15 @@ class IConnection {
void Clear();
bool IsClear() const;

const IList& Start() const;
const IList& End() const;
const List& Start() const;
const List& End() const;

void Restart(const IList& istart, bool total = true);
void SetEnd(const IList& iend);
void Restart(const List& istart, bool total = true);
void SetEnd(const List& iend);

private:
const IList* m_istart; // starting inode
const IList* m_iend; // inode that makes us bad after we're done, or last
const List* m_istart; // starting inode
const List* m_iend; // inode that makes us bad after we're done, or last
};

}

0 comments on commit cd4299d

Please sign in to comment.
You can’t perform that action at this time.