Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
LabComm
Commits
99430c1c
Commit
99430c1c
authored
Jun 01, 2015
by
Anders Blomdell
Browse files
Removing unneccessary method
parent
39e9af9d
Changes
6
Hide whitespace changes
Inline
Side-by-side
compiler/2014/CS_CodeGen.jrag
View file @
99430c1c
...
...
@@ -416,12 +416,6 @@ aspect CS_Class {
env.println("private class Dispatcher : SampleDispatcher {");
env.indent();
env.println();
env.println("public SampleDispatcher getSampleIdentity() {");
env.indent();
env.println("return dispatcher;");
env.unindent();
env.println("}");
env.println();
env.println("public String getName() {");
env.indent();
env.println("return \"" + getName() + "\";");
...
...
lib/csharp/se/lth/control/labcomm2014/DecoderChannel.cs
View file @
99430c1c
...
...
@@ -170,7 +170,7 @@ namespace se.lth.control.labcomm2014 {
int
index
=
(
int
)
ReadInt
(
4
);
try
{
DecoderRegistry
.
Entry
e
=
ref_registry
.
get
(
index
);
return
e
.
getSampleDispatcher
()
.
getSampleIdentity
()
;
return
e
.
getSampleDispatcher
();
}
catch
(
NullReferenceException
)
{
return
null
;
}
...
...
lib/csharp/se/lth/control/labcomm2014/DecoderRegistry.cs
View file @
99430c1c
...
...
@@ -90,11 +90,11 @@ namespace se.lth.control.labcomm2014 {
}
}
private
Dictionary
<
SampleDispatcher
,
Entry
>
by
Identity
;
private
Dictionary
<
SampleDispatcher
,
Entry
>
by
Dispatcher
;
private
Dictionary
<
int
,
Entry
>
byIndex
;
public
DecoderRegistry
()
{
by
Identity
=
new
Dictionary
<
SampleDispatcher
,
Entry
>();
by
Dispatcher
=
new
Dictionary
<
SampleDispatcher
,
Entry
>();
byIndex
=
new
Dictionary
<
int
,
Entry
>();
}
...
...
@@ -102,7 +102,7 @@ namespace se.lth.control.labcomm2014 {
SampleHandler
handler
)
{
lock
(
this
)
{
Entry
e
;
by
Identity
.
TryGetValue
(
dispatcher
.
getSampleIdentity
()
,
out
e
);
by
Dispatcher
.
TryGetValue
(
dispatcher
,
out
e
);
if
(
e
!=
null
)
{
e
.
check
(
dispatcher
.
getName
(),
dispatcher
.
getSignature
());
e
.
setHandler
(
handler
);
...
...
@@ -117,7 +117,7 @@ namespace se.lth.control.labcomm2014 {
}
if
(
e
==
null
)
{
e
=
new
Entry
(
dispatcher
,
handler
);
by
Identity
.
Add
(
dispatcher
.
getSampleIdentity
()
,
e
);
by
Dispatcher
.
Add
(
dispatcher
,
e
);
}
}
}
...
...
@@ -132,7 +132,7 @@ namespace se.lth.control.labcomm2014 {
if
(
e
!=
null
)
{
e
.
check
(
name
,
signature
);
}
else
{
foreach
(
Entry
e2
in
by
Identity
.
Values
)
{
foreach
(
Entry
e2
in
by
Dispatcher
.
Values
)
{
if
(
e2
.
match
(
name
,
signature
))
{
e2
.
setIndex
(
index
);
e
=
e2
;
...
...
lib/csharp/se/lth/control/labcomm2014/EncoderRegistry.cs
View file @
99430c1c
...
...
@@ -26,19 +26,19 @@ namespace se.lth.control.labcomm2014 {
}
private
int
userIndex
=
Constant
.
FIRST_USER_INDEX
;
private
Dictionary
<
SampleDispatcher
,
Entry
>
by
Identity
;
private
Dictionary
<
SampleDispatcher
,
Entry
>
by
Dispatcher
;
public
EncoderRegistry
()
{
by
Identity
=
new
Dictionary
<
SampleDispatcher
,
Entry
>();
by
Dispatcher
=
new
Dictionary
<
SampleDispatcher
,
Entry
>();
}
public
int
add
(
SampleDispatcher
dispatcher
)
{
lock
(
this
)
{
Entry
e
;
by
Identity
.
TryGetValue
(
dispatcher
.
getSampleIdentity
()
,
out
e
);
by
Dispatcher
.
TryGetValue
(
dispatcher
,
out
e
);
if
(
e
==
null
)
{
e
=
new
Entry
(
dispatcher
,
userIndex
);
by
Identity
.
Add
(
dispatcher
.
getSampleIdentity
()
,
e
);
by
Dispatcher
.
Add
(
dispatcher
,
e
);
userIndex
++;
}
return
e
.
getIndex
();
...
...
@@ -48,7 +48,7 @@ namespace se.lth.control.labcomm2014 {
public
int
getTag
(
SampleDispatcher
sample
)
{
lock
(
this
)
{
Entry
e
;
by
Identity
.
TryGetValue
(
sample
,
out
e
);
by
Dispatcher
.
TryGetValue
(
sample
,
out
e
);
if
(
e
==
null
)
{
throw
new
Exception
(
"'"
+
sample
.
ToString
()
+
...
...
lib/csharp/se/lth/control/labcomm2014/RenamingRegistry.cs
View file @
99430c1c
...
...
@@ -16,10 +16,6 @@ namespace se.lth.control.labcomm2014 {
this
.
name
=
name
;
}
public
SampleDispatcher
getSampleIdentity
()
{
return
this
;
}
public
String
getName
()
{
return
name
;
}
...
...
lib/csharp/se/lth/control/labcomm2014/SampleDispatcher.cs
View file @
99430c1c
...
...
@@ -4,8 +4,6 @@ namespace se.lth.control.labcomm2014 {
public
interface
SampleDispatcher
{
SampleDispatcher
getSampleIdentity
();
String
getName
();
byte
[]
getSignature
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment