-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,035 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,6 @@ tmp* | |
.classpath | ||
.project | ||
.settings | ||
|
||
.gitattributes | ||
|
||
.metadata/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package org.scalameter | ||
|
||
|
||
|
||
/** Object containing keys specific to the ScalaMeter benchmarking framework. | ||
*/ | ||
object FrameworkKey { | ||
object FrameworkKey extends KeyContainer("", null) { | ||
|
||
object dsl { | ||
object dsl extends KeyContainer("dsl", FrameworkKey.this) { | ||
lazy val executor = Key[Executor]("executor") | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package org.scalameter; | ||
|
||
import java.io.IOException; | ||
import java.io.ObjectInputStream; | ||
import java.io.ObjectOutputStream; | ||
import java.io.Serializable; | ||
import java.lang.reflect.InvocationTargetException; | ||
import java.lang.reflect.Method; | ||
|
||
//Makes the object Method Serializable, taken from http:https://stackoverflow.com/questions/4919205/java-serializing-methods | ||
public class SerializableMethod implements Serializable { | ||
private static final long serialVersionUID = 6631604036553063682L; | ||
private Method method; | ||
|
||
public SerializableMethod(Method method) | ||
{ | ||
this.method = method; | ||
} | ||
|
||
public Method getMethod() | ||
{ | ||
return method; | ||
} | ||
public void invoke(Object o){ | ||
try { | ||
method.invoke(o); | ||
} catch (IllegalAccessException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} catch (IllegalArgumentException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} catch (InvocationTargetException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
public Object invokeA(Object o1, Object o2){ | ||
Object ret = null; | ||
try { | ||
ret = method.invoke(o1, o2); | ||
} catch (IllegalAccessException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} catch (IllegalArgumentException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} catch (InvocationTargetException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
return ret; | ||
} | ||
private void writeObject(ObjectOutputStream out) throws IOException | ||
{ | ||
out.writeObject(method.getDeclaringClass()); | ||
out.writeUTF(method.getName()); | ||
out.writeObject(method.getParameterTypes()); | ||
} | ||
|
||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException | ||
{ | ||
Class<?> declaringClass = (Class<?>)in.readObject(); | ||
String methodName = in.readUTF(); | ||
Class<?>[] parameterTypes = (Class<?>[])in.readObject(); | ||
try | ||
{ | ||
method = declaringClass.getMethod(methodName, parameterTypes); | ||
} | ||
catch (Exception e) | ||
{ | ||
throw new IOException(String.format("Error occurred resolving deserialized method '%s.%s'", declaringClass.getSimpleName(), methodName), e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.