| 41 | using namespace soarxml; |
| 42 | |
| 43 | Kernel::Kernel(Connection* pConnection) |
| 44 | { |
| 45 | m_Connection = pConnection ; |
| 46 | m_TimeTagCounter = 0 ; |
| 47 | m_IdCounter = 0 ; |
| 48 | m_SocketLibrary = NULL ; |
| 49 | m_LastError = Error::kNoError ; |
| 50 | m_CallbackIDCounter = 0 ; |
| 51 | m_pEventThread = 0 ; |
| 52 | m_pEventMap = new Events() ; |
| 53 | m_bTracingCommunications = false ; |
| 54 | m_bShutdown = false ; |
| 55 | m_ConnectionInfoChanged = false ; |
| 56 | m_bIgnoreOutput = false ; |
| 57 | m_FilteringEnabled = true ; |
| 58 | m_CommandLineSucceeded = false; |
| 59 | |
| 60 | // We're turning on auto commit by default, so clients are a bit slower but easier to write. |
| 61 | // Power users are free to turn it off and use explicit commit calls. |
| 62 | m_bAutoCommit = true ; |
| 63 | |
| 64 | ClearError() ; |
| 65 | |
| 66 | if (pConnection) |
| 67 | { |
| 68 | m_pEventThread = new EventThread(pConnection) ; |
| 69 | |
| 70 | // We start the event thread for asynch connections (remote and embedded on a new thread). |
| 71 | // Synchronous ones don't need it as the kernel can simply call right over to the client directly |
| 72 | // for those. |
| 73 | if (pConnection->IsAsynchronous()) |
| 74 | { |
| 75 | m_pEventThread->Start() ; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | /* voigtjr, rmarinie |
| 80 | * |
| 81 | * Upon further tinkering, we have discovered that the use of the code within |
| 82 | * the following symbol on Linux is no longer necessary, and, in fact, causes |
| 83 | * problems, but we are leaving it in in case our analysis turns out to be |
| 84 | * incorrect. |
| 85 | */ |
| 86 | |
| 87 | //#ifdef LINUX_STATIC_LINK |
| 88 | // On Linux the linker only makes a single pass through the libraries |
| 89 | // so if we try to statically link all of the code together, it fails to |
| 90 | // see sml_ProcessMessage and the other methods that are exported from KernelSML because |
| 91 | // they are only referenced within EmbeddedConnection (inside ConnectionSML.lib) |
| 92 | // which has to come later on the linker's command line than KernelSML. |
| 93 | // A way to resolve this is to make an access from here in ClientSML (which appears |
| 94 | // before KernelSML on the command line for the linker) to the |
| 95 | // methods in KernelSML, which will force the linker to pull the code into the final executable. |
| 96 | // |
| 97 | // If we're in Windows this is not an issue (because the Windows linker supports these cyclical references) |
| 98 | // and if we're loading KernelSML dynamically (the normal fashion) this is also not a problem. |
| 99 | // sml_ProcessMessage(0,0,0); |
| 100 | // sml_CreateEmbeddedConnection(0,0,0,0); |
nothing calls this directly
no test coverage detected