summaryrefslogtreecommitdiff
path: root/IvyTest
diff options
context:
space:
mode:
authorfcolin2007-02-01 13:29:31 +0000
committerfcolin2007-02-01 13:29:31 +0000
commitafe2e7dfc1388cad991e8d38dda7d648c137aa52 (patch)
tree92bf63d2b2b34a805927aa294c7c51912638f66a /IvyTest
parent0be65f8a110ee9bf5da9c93e0bd5b5b62b3bad0c (diff)
parent04c263c314499e38d64af9d4a1aa5e2b8d9d5ead (diff)
downloadivy-cplusplus-afe2e7dfc1388cad991e8d38dda7d648c137aa52.zip
ivy-cplusplus-afe2e7dfc1388cad991e8d38dda7d648c137aa52.tar.gz
ivy-cplusplus-afe2e7dfc1388cad991e8d38dda7d648c137aa52.tar.bz2
ivy-cplusplus-afe2e7dfc1388cad991e8d38dda7d648c137aa52.tar.xz
modif struct svnwindows@3001
Diffstat (limited to 'IvyTest')
-rw-r--r--IvyTest/IvyTest.vcproj139
-rw-r--r--IvyTest/IvyTest.vcproj.vspscc10
-rw-r--r--IvyTest/ivytest.cpp84
3 files changed, 233 insertions, 0 deletions
diff --git a/IvyTest/IvyTest.vcproj b/IvyTest/IvyTest.vcproj
new file mode 100644
index 0000000..584e06e
--- /dev/null
+++ b/IvyTest/IvyTest.vcproj
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding = "Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.00"
+ Name="IvyTest"
+ SccProjectName="&quot;$/Bus&quot;, ZOBAAAAA"
+ SccAuxPath=""
+ SccLocalPath=".."
+ SccProvider="MSSCCI:Microsoft Visual SourceSafe">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="C:\users\fcolin\Program Files\$(ConfigurationName)"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile=".\Release/IvyTest.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="odbc32.lib odbccp32.lib"
+ OutputFile=".\Release/IvyTest.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="TRUE"
+ ProgramDatabaseFile=".\Release/IvyTest.pdb"
+ SubSystem="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Release/IvyTest.tlb"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1036"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="C:\users\fcolin\Program Files\$(ConfigurationName)"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;C:\users\fcolin\C++\Bus\Ivy&quot;"
+ PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile=".\Debug/IvyTest.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="odbc32.lib odbccp32.lib"
+ OutputFile=".\Debug/IvyTest.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="TRUE"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile=".\Debug/IvyTest.pdb"
+ SubSystem="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Debug/IvyTest.tlb"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1036"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ </Configuration>
+ </Configurations>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+ <File
+ RelativePath=".\ivytest.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/IvyTest/IvyTest.vcproj.vspscc b/IvyTest/IvyTest.vcproj.vspscc
new file mode 100644
index 0000000..1046691
--- /dev/null
+++ b/IvyTest/IvyTest.vcproj.vspscc
@@ -0,0 +1,10 @@
+""
+{
+"FILE_VERSION" = "9237"
+"ENLISTMENT_CHOICE" = "NEVER"
+"PROJECT_FILE_RELATIVE_PATH" = "relative:IvyTest"
+"NUMBER_OF_EXCLUDED_FILES" = "0"
+"ORIGINAL_PROJECT_FILE_PATH" = ""
+"NUMBER_OF_NESTED_PROJECTS" = "0"
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
+}
diff --git a/IvyTest/ivytest.cpp b/IvyTest/ivytest.cpp
new file mode 100644
index 0000000..370901e
--- /dev/null
+++ b/IvyTest/ivytest.cpp
@@ -0,0 +1,84 @@
+// ivytest.cpp : Defines the entry point for the console application.
+//
+#include <iostream>
+
+#include <stdlib.h>
+using namespace std;
+
+#include "Ivy.h"
+#include "IvyApplication.h"
+
+static bool TheGrassIsGreenAndTheWindBlows = true;
+
+class cIvyTranslater : public IvyApplicationCallback
+{
+public:
+ cIvyTranslater(void);
+ ~cIvyTranslater();
+protected:
+ void OnApplicationConnected ( IvyApplication *app );
+ void OnApplicationDisconnected( IvyApplication *app );
+ void HelloCallback ( IvyApplication *app, int argc, const char **argv );
+ void ByeCallback ( IvyApplication *app, int argc, const char **argv );
+ Ivy *bus;
+};
+
+
+
+cIvyTranslater::cIvyTranslater(void)
+{
+ // initialization
+ bus = new Ivy( "cIvyTranslater","cIvyTranslater READY",this,FALSE);
+
+ int count;
+ count = bus->BindMsg( "^Hello(.*)", BUS_CALLBACK_OF(cIvyTranslater, HelloCallback ));
+ count = bus->BindMsg( "^Bye$", BUS_CALLBACK_OF(cIvyTranslater, ByeCallback ));
+
+ bus->start(NULL);
+}
+cIvyTranslater::~cIvyTranslater(void)
+{
+ bus->stop();
+ delete bus;
+}
+
+void cIvyTranslater::HelloCallback(IvyApplication *app, int argc, const char **argv)
+{
+ const char* arg = (argc < 1) ? "" : argv[0];
+ cout << "cIvyTranslater received msg: Hello'" << arg << "'" << endl;
+ bus->SendMsg( "Bonjour%s!", arg );
+}
+
+void cIvyTranslater::ByeCallback(IvyApplication *app, int argc, const char **argv)
+{
+ cout << "cIvyTranslater stops bus" << endl;
+ if (bus) {
+ TheGrassIsGreenAndTheWindBlows = false;
+ // This is causing the fatal bug
+// bus->stop();
+// delete bus; // This statement is never reached! Don't know why!
+ }
+
+}
+
+void cIvyTranslater::OnApplicationConnected(IvyApplication *app)
+{
+ cout << "cIvyTranslater is ready to accept messages from " << app->GetName() << endl;
+}
+
+void cIvyTranslater::OnApplicationDisconnected(IvyApplication *app)
+{
+ cout << "cIvyTranslater good buy '" << app->GetName() << "'" << endl;
+}
+
+
+void main(int argc, char* argv[])
+{
+ cIvyTranslater aIvyTL;
+
+ while (TheGrassIsGreenAndTheWindBlows) {
+ Sleep(2000);
+ cout << "new cycle..." << endl;
+ }
+ cout << "Good buy, world\n";
+} \ No newline at end of file