Skip to content

Commit

Permalink
Add new combined neo/legacy node and connection bases
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Norman committed Aug 23, 2017
1 parent df877dd commit 81df0c6
Show file tree
Hide file tree
Showing 14 changed files with 1,905 additions and 75 deletions.
3 changes: 2 additions & 1 deletion src/swarm/neo/node/ConnectionHandler.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*******************************************************************************/

module swarm.neo.node.ConnectionHandler;
deprecated module swarm.neo.node.ConnectionHandler;

/*******************************************************************************
Expand All @@ -46,6 +46,7 @@ static this ( )

/******************************************************************************/

deprecated("Replace with swarm.node.simplified.NeoConnectionHandler;")
class ConnectionHandler : IConnectionHandler
{
import swarm.neo.node.Connection;
Expand Down
4 changes: 3 additions & 1 deletion src/swarm/node/connection/ConnectionHandler.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*******************************************************************************/

module swarm.node.connection.ConnectionHandler;
deprecated module swarm.node.connection.ConnectionHandler;



Expand Down Expand Up @@ -160,6 +160,7 @@ public class ConnectionSetupParams
*******************************************************************************/

deprecated("Replace with swarm.node.simplified.LegacyConnectionHandlerTemplate")
public abstract class ConnectionHandlerTemplate ( Commands : ICommandCodes )
: ISwarmConnectionHandler
{
Expand Down Expand Up @@ -379,6 +380,7 @@ public abstract class ConnectionHandlerTemplate ( Commands : ICommandCodes )
*******************************************************************************/

deprecated("Replace with swarm.node.simplified.LegacyConnectionHandlerBase")
abstract public class ISwarmConnectionHandler : IFiberConnectionHandlerBase,
Resettable, ISwarmConnectionHandlerInfo
{
Expand Down
13 changes: 7 additions & 6 deletions src/swarm/node/model/ChannelsNode.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*******************************************************************************/

module swarm.node.model.ChannelsNode;
deprecated module swarm.node.model.ChannelsNode;



Expand Down Expand Up @@ -46,6 +46,7 @@ import ocean.transition;
*******************************************************************************/

deprecated("Replace with swarm.node.simplified.ChannelsNodeTemplate")
public class ChannelsNodeBase
( Storage : IStorageEngine, ConnHandler : ISwarmConnectionHandler )
: NodeBase!(ConnHandler), IChannelsNodeInfo
Expand Down Expand Up @@ -206,8 +207,11 @@ public class ChannelsNodeBase
version (UnitTest)
{
import ocean.net.server.connection.IConnectionHandler;
}

private class TestConnectionHandler : ISwarmConnectionHandler
deprecated unittest
{
static class TestConnectionHandler : ISwarmConnectionHandler
{
public this (void delegate(IConnectionHandler) a, ConnectionSetupParams b)
{
Expand All @@ -216,7 +220,7 @@ version (UnitTest)
override protected void handleCommand () {}
}

private class TestStorageEngine : IStorageEngine
static class TestStorageEngine : IStorageEngine
{
public this ()
{
Expand All @@ -227,9 +231,6 @@ version (UnitTest)
public ulong num_records () { return 42; }
public ulong num_bytes () { return 42; }
}
}

unittest
{
alias ChannelsNodeBase!(TestStorageEngine, TestConnectionHandler) Instance;
}
13 changes: 7 additions & 6 deletions src/swarm/node/model/NeoChannelsNode.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*******************************************************************************/

module swarm.node.model.NeoChannelsNode;
deprecated module swarm.node.model.NeoChannelsNode;



Expand Down Expand Up @@ -47,6 +47,7 @@ import ocean.transition;
*******************************************************************************/

deprecated("Replace with swarm.node.simplified.ChannelsNodeTemplate")
public class ChannelsNodeBase (
Storage : IStorageEngine,
ConnHandler : ISwarmConnectionHandler
Expand Down Expand Up @@ -232,8 +233,11 @@ public class ChannelsNodeBase (
version (UnitTest)
{
import ocean.net.server.connection.IConnectionHandler;
}

private class TestConnectionHandler : ISwarmConnectionHandler
deprecated unittest
{
static class TestConnectionHandler : ISwarmConnectionHandler
{
public this (void delegate(IConnectionHandler) a, ConnectionSetupParams b)
{
Expand All @@ -242,7 +246,7 @@ version (UnitTest)
override protected void handleCommand () {}
}

private class TestStorageEngine : IStorageEngine
static class TestStorageEngine : IStorageEngine
{
public this ()
{
Expand All @@ -253,9 +257,6 @@ version (UnitTest)
public ulong num_records () { return 42; }
public ulong num_bytes () { return 42; }
}
}

unittest
{
alias ChannelsNodeBase!(TestStorageEngine, TestConnectionHandler) Instance;
}
12 changes: 5 additions & 7 deletions src/swarm/node/model/NeoNode.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*******************************************************************************/

module swarm.node.model.NeoNode;
deprecated module swarm.node.model.NeoNode;



Expand Down Expand Up @@ -77,6 +77,7 @@ static this ( )
*******************************************************************************/

deprecated("Replace with swarm.node.simplified.NodeBase")
public abstract class INodeBase : INode, INodeInfo
{
/***************************************************************************
Expand Down Expand Up @@ -552,6 +553,7 @@ public abstract class INodeBase : INode, INodeInfo
*******************************************************************************/

deprecated("Replace with swarm.node.simplified.NodeTemplate")
public class NodeBase ( ConnHandler : ISwarmConnectionHandler ) : INodeBase
{
import ocean.net.server.unix.UnixListener;
Expand Down Expand Up @@ -868,20 +870,16 @@ public class NodeBase ( ConnHandler : ISwarmConnectionHandler ) : INodeBase
}
}


version (UnitTest)
deprecated unittest
{
private class TestConnectionHandler : ISwarmConnectionHandler
static class TestConnectionHandler : ISwarmConnectionHandler
{
public this (void delegate(IConnectionHandler) a, ConnectionSetupParams b)
{
super(a, b);
}
override protected void handleCommand () {}
}
}

unittest
{
alias NodeBase!(TestConnectionHandler) Instance;
}
12 changes: 5 additions & 7 deletions src/swarm/node/model/Node.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*******************************************************************************/

module swarm.node.model.Node;
deprecated module swarm.node.model.Node;



Expand Down Expand Up @@ -75,6 +75,7 @@ static this ( )
*******************************************************************************/

deprecated("Replace with swarm.node.simplified.NodeBase")
public abstract class INodeBase : INode, INodeInfo
{
/***************************************************************************
Expand Down Expand Up @@ -495,6 +496,7 @@ public abstract class INodeBase : INode, INodeInfo
*******************************************************************************/

deprecated("Replace with swarm.node.simplified.NodeTemplate")
public class NodeBase ( ConnHandler : ISwarmConnectionHandler,
Setup : ConnectionSetupParams = ConnectionSetupParams ) : INodeBase
{
Expand Down Expand Up @@ -617,20 +619,16 @@ public class NodeBase ( ConnHandler : ISwarmConnectionHandler,
}
}


version (UnitTest)
deprecated unittest
{
private class TestConnectionHandler : ISwarmConnectionHandler
static class TestConnectionHandler : ISwarmConnectionHandler
{
public this (void delegate(IConnectionHandler) a, ConnectionSetupParams b)
{
super(a, b);
}
override protected void handleCommand () {}
}
}

unittest
{
alias NodeBase!(TestConnectionHandler) Instance;
}
2 changes: 1 addition & 1 deletion src/swarm/node/model/RecordActionCounters.d
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class RecordActionCounters
***************************************************************************/

package this ( in cstring[] ids )
public this ( in cstring[] ids )
{
foreach (id; ids)
{
Expand Down
Loading

0 comments on commit 81df0c6

Please sign in to comment.