aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2006-04-18 01:38:08 +0000
committerThomas Grill <xovo@users.sourceforge.net>2006-04-18 01:38:08 +0000
commited0031b621c6cf8824a9a3e588426907244aeb7e (patch)
treea797d5ee35b65b43f970f331cdee940d7aaced32 /test
parent4e7353f45954a8a5d9aaa3dd40eed3f9f62c2062 (diff)
implemented class-based method management
very fast native-to-managed transition most of the logic transferred to the CLR side svn path=/trunk/externals/clr/; revision=4931
Diffstat (limited to 'test')
-rw-r--r--test/test-help.pd53
-rw-r--r--test/test.cs63
-rw-r--r--test/test.csproj217
3 files changed, 170 insertions, 163 deletions
diff --git a/test/test-help.pd b/test/test-help.pd
index 26246c4..a931342 100644
--- a/test/test-help.pd
+++ b/test/test-help.pd
@@ -1,4 +1,4 @@
-#N canvas 617 153 862 841 12;
+#N canvas 617 153 866 845 12;
#X floatatom 125 51 5 0 0 0 - - -;
#X symbolatom 320 81 10 0 0 0 - - -;
#X msg 536 45 msg one 2 three;
@@ -20,8 +20,6 @@
#X msg 289 197 send \$1 b c;
#X obj 407 497 print RECV1;
#X obj 406 463 r receiver;
-#X obj 554 465 r receiver2;
-#X obj 555 499 print RECV2;
#X floatatom 526 362 5 0 0 0 - - -;
#X symbolatom 578 364 10 0 0 0 - - -;
#X text 585 318 passive - bang to see;
@@ -38,34 +36,33 @@
#X obj 141 650 print A;
#X obj 138 725 print B;
#X msg 120 580 trigger;
-#X connect 0 0 30 0;
-#X connect 1 0 30 0;
-#X connect 2 0 30 0;
+#X connect 0 0 28 0;
+#X connect 1 0 28 0;
+#X connect 2 0 28 0;
#X connect 3 0 8 0;
#X connect 4 0 5 0;
-#X connect 5 0 30 0;
+#X connect 5 0 28 0;
#X connect 6 0 1 0;
#X connect 7 0 1 0;
-#X connect 8 0 30 0;
-#X connect 9 0 30 0;
-#X connect 10 0 30 0;
-#X connect 11 0 30 0;
-#X connect 12 0 30 0;
-#X connect 13 0 30 1;
-#X connect 15 0 30 2;
+#X connect 8 0 28 0;
+#X connect 9 0 28 0;
+#X connect 10 0 28 0;
+#X connect 11 0 28 0;
+#X connect 12 0 28 0;
+#X connect 13 0 28 1;
+#X connect 15 0 28 2;
#X connect 16 0 17 0;
-#X connect 17 0 30 0;
+#X connect 17 0 28 0;
#X connect 19 0 18 0;
-#X connect 20 0 21 0;
-#X connect 22 0 30 3;
-#X connect 23 0 30 3;
-#X connect 26 0 30 3;
-#X connect 27 0 30 1;
-#X connect 28 0 30 3;
-#X connect 29 0 30 1;
-#X connect 30 0 14 0;
-#X connect 31 0 30 3;
-#X connect 32 0 33 0;
-#X connect 32 0 34 0;
-#X connect 33 0 35 0;
-#X connect 36 0 32 0;
+#X connect 20 0 28 3;
+#X connect 21 0 28 3;
+#X connect 24 0 28 3;
+#X connect 25 0 28 1;
+#X connect 26 0 28 3;
+#X connect 27 0 28 1;
+#X connect 28 0 14 0;
+#X connect 29 0 28 3;
+#X connect 30 0 31 0;
+#X connect 30 0 32 0;
+#X connect 31 0 33 0;
+#X connect 34 0 30 0;
diff --git a/test/test.cs b/test/test.cs
index beac897..cdb7ba7 100644
--- a/test/test.cs
+++ b/test/test.cs
@@ -1,18 +1,22 @@
using System;
+using Timing;
+using PureData;
public class test:
- PureData.External
+ External
{
- PureData.Atom[] args;
-
+ Atom[] args;
float farg;
- public test(PureData.AtomList args)
+ // necessary (for now...)
+ public test() {}
+
+ public test(Atom[] args)
{
Post("Test.ctor "+args.ToString());
- // that's the way to store args (don't just copy an AtomList instance!!)
- this.args = (PureData.Atom[])args;
+ // save args
+ this.args = args;
// AddInlet(s_list,new PureData.Symbol("list2"));
AddInlet();
@@ -25,23 +29,23 @@ public class test:
// returns void or ClassType
private static ClassType Setup(test obj)
{
- AddMethod(0,new Method(obj.MyBang));
- AddMethod(0,new MethodFloat(obj.MyFloat));
- AddMethod(0,new MethodSymbol(obj.MySymbol));
- AddMethod(0,new MethodList(obj.MyList));
- AddMethod(0,"set",new MethodAnything(obj.MySet));
- AddMethod(0,"send",new MethodAnything(obj.MySend));
- AddMethod(0,"trigger",new Method(obj.MyTrigger));
- AddMethod(0,new MethodObject(obj.MyObject));
- AddMethod(0,new MethodAnything(obj.MyAnything));
- AddMethod(1,new MethodFloat(obj.MyFloat1));
- AddMethod(1,new MethodAnything(obj.MyAny1));
-
- Post("Test.Main");
+// Post("Test.Setup");
+
+ AddMethod(obj.bang);
+ AddMethod(obj.MyFloat);
+ AddMethod(obj.symbol);
+ AddMethod(obj.list);
+ AddMethod(0,"set",obj.set);
+ AddMethod(0,"send",obj.send);
+ AddMethod(0,"trigger",obj.trigger);
+ AddMethod(0,obj.MyObject);
+ AddMethod(0,obj.MyAnything);
+ AddMethod(1,obj.MyFloat1);
+ AddMethod(1,obj.MyAny1);
return ClassType.Default;
}
- protected virtual void MyBang()
+ protected void bang()
{
Post("Test-BANG "+farg.ToString());
Outlet(0);
@@ -58,36 +62,35 @@ public class test:
Post("Test-FLOAT1 "+f.ToString());
}
- protected virtual void MyAny1(int ix,PureData.Symbol s,PureData.AtomList l)
+ protected virtual void MyAny1(int ix,Symbol s,Atom[] l)
{
Post(ix.ToString()+": Test-ANY1 "+l.ToString());
}
- protected virtual void MySymbol(PureData.Symbol s)
+ protected virtual void symbol(Symbol s)
{
Post("Test-SYMBOL "+s.ToString());
Outlet(0,s);
}
- protected virtual void MyList(PureData.AtomList l)
+ protected virtual void list(Atom[] l)
{
Post("Test-LIST "+l.ToString());
Outlet(0,l);
}
- protected virtual void MySet(int ix,PureData.Symbol s,PureData.AtomList l)
+ protected virtual void set(int ix,Symbol s,Atom[] l)
{
Post("Test-SET "+l.ToString());
- Outlet(0,new PureData.Symbol("set"),l);
+ Outlet(0,new Symbol("set"),l);
}
- protected virtual void MySend(int ix,PureData.Symbol s,PureData.AtomList l)
+ protected virtual void send(int ix,Symbol s,Atom[] l)
{
- Send(new PureData.Symbol("receiver"),l);
- Send(new PureData.Symbol("receiver2"),(PureData.Atom[])l);
+ Send(new Symbol("receiver"),l);
}
- protected virtual void MyTrigger()
+ protected virtual void trigger()
{
OutletEx(0,"hey");
}
@@ -98,7 +101,7 @@ public class test:
OutletEx(0,obj);
}
- protected virtual void MyAnything(int ix,PureData.Symbol s,PureData.AtomList l)
+ protected virtual void MyAnything(int ix,Symbol s,Atom[] l)
{
Post(ix.ToString()+": Test-("+s.ToString()+") "+l.ToString());
Outlet(0,s,l);
diff --git a/test/test.csproj b/test/test.csproj
index d4f4e7d..1b2d888 100644
--- a/test/test.csproj
+++ b/test/test.csproj
@@ -1,105 +1,112 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.10.3077"
- SchemaVersion = "2.0"
- ProjectGuid = "{6CED2448-6407-4AF7-95B6-932D8118AF3D}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "Test"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Library"
- PreBuildEvent = ""
- PostBuildEvent = ""
- RootNamespace = "Test"
- RunPostBuildEvent = "OnBuildSuccess"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- NoStdLib = "false"
- NoWarn = ""
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- NoStdLib = "false"
- NoWarn = ""
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.XML"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
- />
- <Reference
- Name = "PureData"
- Project = "{0015D5E7-B0FB-4F06-B334-225447D1F992}"
- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "AssemblyInfo.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "test.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{6CED2448-6407-4AF7-95B6-932D8118AF3D}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ApplicationIcon>
+ </ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
+ <AssemblyName>Test</AssemblyName>
+ <AssemblyOriginatorKeyFile>
+ </AssemblyOriginatorKeyFile>
+ <DefaultClientScript>JScript</DefaultClientScript>
+ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+ <DefaultTargetSchema>IE50</DefaultTargetSchema>
+ <DelaySign>false</DelaySign>
+ <OutputType>Library</OutputType>
+ <RootNamespace>Test</RootNamespace>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <StartupObject>
+ </StartupObject>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoStdLib>false</NoStdLib>
+ <NoWarn>
+ </NoWarn>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ <UseVSHostingProcess>true</UseVSHostingProcess>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\debug\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>false</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoStdLib>false</NoStdLib>
+ <NoWarn>
+ </NoWarn>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>none</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ <UseVSHostingProcess>true</UseVSHostingProcess>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System">
+ <Name>System</Name>
+ </Reference>
+ <Reference Include="System.Data">
+ <Name>System.Data</Name>
+ </Reference>
+ <Reference Include="System.Xml">
+ <Name>System.XML</Name>
+ </Reference>
+ <ProjectReference Include="..\PureData\PureData.csproj">
+ <Name>PureData</Name>
+ <Project>{0015D5E7-B0FB-4F06-B334-225447D1F992}</Project>
+ <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="test.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="timing.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PreBuildEvent>
+ </PreBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+</Project> \ No newline at end of file