Skip to content

Commit

Permalink
Rename uno (#9)
Browse files Browse the repository at this point in the history
* Rename Uno to SingleRouter
  • Loading branch information
nicmcd authored Feb 27, 2020
1 parent ae3268f commit 04984c5
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
},
"network": {
"topology": "uno",
"topology": "single_router",
"concentration": 16,
"protocol_classes": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
},
"network": {
"topology": "uno",
"topology": "single_router",
"concentration": 16,
"protocol_classes": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "network/uno/DirectRoutingAlgorithm.h"
#include "network/singlerouter/DirectRoutingAlgorithm.h"

#include <factory/ObjectFactory.h>

Expand All @@ -23,7 +23,7 @@
#include "types/Packet.h"
#include "types/Message.h"

namespace Uno {
namespace SingleRouter {

DirectRoutingAlgorithm::DirectRoutingAlgorithm(
const std::string& _name, const Component* _parent, Router* _router,
Expand Down Expand Up @@ -71,8 +71,8 @@ void DirectRoutingAlgorithm::processRequest(
}
}

} // namespace Uno
} // namespace SingleRouter

registerWithObjectFactory(
"direct", Uno::RoutingAlgorithm,
Uno::DirectRoutingAlgorithm, UNO_ROUTINGALGORITHM_ARGS);
"direct", SingleRouter::RoutingAlgorithm,
SingleRouter::DirectRoutingAlgorithm, SINGLEROUTER_ROUTINGALGORITHM_ARGS);
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef NETWORK_UNO_DIRECTROUTINGALGORITHM_H_
#define NETWORK_UNO_DIRECTROUTINGALGORITHM_H_
#ifndef NETWORK_SINGLEROUTER_DIRECTROUTINGALGORITHM_H_
#define NETWORK_SINGLEROUTER_DIRECTROUTINGALGORITHM_H_

#include <json/json.h>
#include <prim/prim.h>

#include <string>

#include "event/Component.h"
#include "network/uno/RoutingAlgorithm.h"
#include "network/singlerouter/RoutingAlgorithm.h"
#include "router/Router.h"

namespace Uno {
namespace SingleRouter {

class DirectRoutingAlgorithm : public Uno::RoutingAlgorithm {
class DirectRoutingAlgorithm : public SingleRouter::RoutingAlgorithm {
public:
DirectRoutingAlgorithm(
const std::string& _name, const Component* _parent, Router* _router,
Expand All @@ -42,6 +42,6 @@ class DirectRoutingAlgorithm : public Uno::RoutingAlgorithm {
const bool adaptive_;
};

} // namespace Uno
} // namespace SingleRouter

#endif // NETWORK_UNO_DIRECTROUTINGALGORITHM_H_
#endif // NETWORK_SINGLEROUTER_DIRECTROUTINGALGORITHM_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "network/uno/Network.h"
#include "network/singlerouter/Network.h"

#include <factory/ObjectFactory.h>

Expand All @@ -21,9 +21,9 @@

#include <tuple>

#include "network/uno/RoutingAlgorithm.h"
#include "network/singlerouter/RoutingAlgorithm.h"

namespace Uno {
namespace SingleRouter {

Network::Network(const std::string& _name, const Component* _parent,
MetadataHandler* _metadataHandler, Json::Value _settings)
Expand Down Expand Up @@ -153,7 +153,7 @@ void Network::collectChannels(std::vector<Channel*>* _channels) {
}
}

} // namespace Uno
} // namespace SingleRouter

registerWithObjectFactory("uno", ::Network,
Uno::Network, NETWORK_ARGS);
registerWithObjectFactory("single_router", ::Network,
SingleRouter::Network, NETWORK_ARGS);
10 changes: 5 additions & 5 deletions src/network/uno/Network.h → src/network/singlerouter/Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef NETWORK_UNO_NETWORK_H_
#define NETWORK_UNO_NETWORK_H_
#ifndef NETWORK_SINGLEROUTER_NETWORK_H_
#define NETWORK_SINGLEROUTER_NETWORK_H_

#include <json/json.h>
#include <prim/prim.h>
Expand All @@ -27,7 +27,7 @@
#include "network/Network.h"
#include "router/Router.h"

namespace Uno {
namespace SingleRouter {

class Network : public ::Network {
public:
Expand Down Expand Up @@ -67,6 +67,6 @@ class Network : public ::Network {
std::vector<Interface*> interfaces_;
};

} // namespace Uno
} // namespace SingleRouter

#endif // NETWORK_UNO_NETWORK_H_
#endif // NETWORK_SINGLEROUTER_NETWORK_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "network/uno/RoutingAlgorithm.h"
#include "network/singlerouter/RoutingAlgorithm.h"

#include <factory/ObjectFactory.h>

namespace Uno {
namespace SingleRouter {

RoutingAlgorithm::RoutingAlgorithm(
const std::string& _name, const Component* _parent, Router* _router,
Expand All @@ -37,16 +37,17 @@ RoutingAlgorithm* RoutingAlgorithm::create(

// attempt to create the routing algorithm
RoutingAlgorithm* ra = factory::ObjectFactory<
RoutingAlgorithm, UNO_ROUTINGALGORITHM_ARGS>::create(
RoutingAlgorithm, SINGLEROUTER_ROUTINGALGORITHM_ARGS>::create(
algorithm, _name, _parent, _router, _baseVc, _numVcs, _inputPort,
_inputVc, _concentration, _settings);

// check that the factory had this type
if (ra == nullptr) {
fprintf(stderr, "invalid Uno routing algorithm: %s\n", algorithm.c_str());
fprintf(stderr, "invalid SingleRouter routing algorithm: %s\n",
algorithm.c_str());
assert(false);
}
return ra;
}

} // namespace Uno
} // namespace SingleRouter
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef NETWORK_UNO_ROUTINGALGORITHM_H_
#define NETWORK_UNO_ROUTINGALGORITHM_H_
#ifndef NETWORK_SINGLEROUTER_ROUTINGALGORITHM_H_
#define NETWORK_SINGLEROUTER_ROUTINGALGORITHM_H_

#include <json/json.h>
#include <prim/prim.h>
Expand All @@ -24,10 +24,10 @@
#include "routing/RoutingAlgorithm.h"
#include "router/Router.h"

#define UNO_ROUTINGALGORITHM_ARGS const std::string&, const Component*, \
Router*, u32, u32, u32, u32, u32, Json::Value
#define SINGLEROUTER_ROUTINGALGORITHM_ARGS const std::string&, \
const Component*, Router*, u32, u32, u32, u32, u32, Json::Value

namespace Uno {
namespace SingleRouter {

class RoutingAlgorithm : public ::RoutingAlgorithm {
public:
Expand All @@ -37,13 +37,13 @@ class RoutingAlgorithm : public ::RoutingAlgorithm {
Json::Value _settings);
virtual ~RoutingAlgorithm();

// this is a routing algorithm factory for the uno topology
static RoutingAlgorithm* create(UNO_ROUTINGALGORITHM_ARGS);
// this is a routing algorithm factory for the SingleRouter topology
static RoutingAlgorithm* create(SINGLEROUTER_ROUTINGALGORITHM_ARGS);

protected:
u32 concentration_;
};

} // namespace Uno
} // namespace SingleRouter

#endif // NETWORK_UNO_ROUTINGALGORITHM_H_
#endif // NETWORK_SINGLEROUTER_ROUTINGALGORITHM_H_

0 comments on commit 04984c5

Please sign in to comment.