[PD-cvs] externals/clr/test test-help.pd, 1.2, 1.3 test.cs, 1.3, 1.4 test.csproj, 1.1, 1.2

Thomas Grill xovo at users.sourceforge.net
Tue Apr 18 03:38:10 CEST 2006


Update of /cvsroot/pure-data/externals/clr/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29449/clr/test

Modified Files:
	test-help.pd test.cs test.csproj 
Log Message:
implemented class-based method management
very fast native-to-managed transition
most of the logic transferred to the CLR side

Index: test.cs
===================================================================
RCS file: /cvsroot/pure-data/externals/clr/test/test.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test.cs	10 Mar 2006 01:01:20 -0000	1.3
--- test.cs	18 Apr 2006 01:38:08 -0000	1.4
***************
*** 1,17 ****
  using System;
  
  public class test:
!     PureData.External
  {
!     PureData.Atom[] args;
! 
      float farg;
  
!     public test(PureData.AtomList 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;
  
          //        AddInlet(s_list,new PureData.Symbol("list2"));
--- 1,21 ----
  using System;
+ using Timing;
+ using PureData;
  
  public class test:
!     External
  {
!     Atom[] args;
      float farg;
  
!     // necessary (for now...)
!     public test() {}  
! 
!     public test(Atom[] args)
      {
          Post("Test.ctor "+args.ToString());
  
!         // save args
!         this.args = args;
  
          //        AddInlet(s_list,new PureData.Symbol("list2"));
***************
*** 26,46 ****
      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");
          return ClassType.Default;
      }
  
!     protected virtual void MyBang() 
      { 
          Post("Test-BANG "+farg.ToString()); 
--- 30,50 ----
      private static ClassType Setup(test obj)
      {
! //        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 void bang() 
      { 
          Post("Test-BANG "+farg.ToString()); 
***************
*** 59,68 ****
      }
  
!     protected virtual void MyAny1(int ix,PureData.Symbol s,PureData.AtomList l) 
      { 
          Post(ix.ToString()+": Test-ANY1 "+l.ToString()); 
      }
  
!     protected virtual void MySymbol(PureData.Symbol s) 
      { 
          Post("Test-SYMBOL "+s.ToString()); 
--- 63,72 ----
      }
  
!     protected virtual void MyAny1(int ix,Symbol s,Atom[] l) 
      { 
          Post(ix.ToString()+": Test-ANY1 "+l.ToString()); 
      }
  
!     protected virtual void symbol(Symbol s) 
      { 
          Post("Test-SYMBOL "+s.ToString()); 
***************
*** 70,74 ****
      }
  
!     protected virtual void MyList(PureData.AtomList l) 
      { 
          Post("Test-LIST "+l.ToString()); 
--- 74,78 ----
      }
  
!     protected virtual void list(Atom[] l) 
      { 
          Post("Test-LIST "+l.ToString()); 
***************
*** 76,92 ****
      }
  
!     protected virtual void MySet(int ix,PureData.Symbol s,PureData.AtomList l) 
      { 
          Post("Test-SET "+l.ToString()); 
!         Outlet(0,new PureData.Symbol("set"),l);
      }
  
!     protected virtual void MySend(int ix,PureData.Symbol s,PureData.AtomList l) 
      { 
!         Send(new PureData.Symbol("receiver"),l);
!         Send(new PureData.Symbol("receiver2"),(PureData.Atom[])l);
      }
  
!     protected virtual void MyTrigger() 
      { 
          OutletEx(0,"hey");
--- 80,95 ----
      }
  
!     protected virtual void set(int ix,Symbol s,Atom[] l) 
      { 
          Post("Test-SET "+l.ToString()); 
!         Outlet(0,new Symbol("set"),l);
      }
  
!     protected virtual void send(int ix,Symbol s,Atom[] l) 
      { 
!         Send(new Symbol("receiver"),l);
      }
  
!     protected virtual void trigger() 
      { 
          OutletEx(0,"hey");
***************
*** 99,103 ****
      }
  
!     protected virtual void MyAnything(int ix,PureData.Symbol s,PureData.AtomList l) 
      { 
          Post(ix.ToString()+": Test-("+s.ToString()+") "+l.ToString()); 
--- 102,106 ----
      }
  
!     protected virtual void MyAnything(int ix,Symbol s,Atom[] l) 
      { 
          Post(ix.ToString()+": Test-("+s.ToString()+") "+l.ToString()); 

Index: test-help.pd
===================================================================
RCS file: /cvsroot/pure-data/externals/clr/test/test-help.pd,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test-help.pd	9 Mar 2006 17:27:37 -0000	1.2
--- test-help.pd	18 Apr 2006 01:38:08 -0000	1.3
***************
*** 1,3 ****
! #N canvas 617 153 862 841 12;
  #X floatatom 125 51 5 0 0 0 - - -;
  #X symbolatom 320 81 10 0 0 0 - - -;
--- 1,3 ----
! #N canvas 617 153 866 845 12;
  #X floatatom 125 51 5 0 0 0 - - -;
  #X symbolatom 320 81 10 0 0 0 - - -;
***************
*** 21,26 ****
  #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 - - -;
--- 21,24 ----
***************
*** 39,71 ****
  #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 3 0 8 0;
  #X connect 4 0 5 0;
! #X connect 5 0 30 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 16 0 17 0;
! #X connect 17 0 30 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;
--- 37,68 ----
  #X obj 138 725 print B;
  #X msg 120 580 trigger;
! #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 28 0;
  #X connect 6 0 1 0;
  #X connect 7 0 1 0;
! #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 28 0;
  #X connect 19 0 18 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;

Index: test.csproj
===================================================================
RCS file: /cvsroot/pure-data/externals/clr/test/test.csproj,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test.csproj	9 Mar 2006 14:34:33 -0000	1.1
--- test.csproj	18 Apr 2006 01:38:08 -0000	1.2
***************
*** 1,105 ****
! <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>
! 
--- 1,112 ----
! <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





More information about the Pd-cvs mailing list