-
Notifications
You must be signed in to change notification settings - Fork 5
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
17 changed files
with
240 additions
and
34 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
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,3 @@ | ||
[submodule "libquickfix"] | ||
path = libquickfix | ||
url = https://github.com/quickfix/quickfix.git | ||
url = https://github.com/arthurlm/quickfix.git |
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
Submodule libquickfix
updated
4 files
+2 −0 | CMakeLists.txt | |
+1 −0 | cmake/QuickfixPrebuildSetup.cmake | |
+1 −1 | src/C++/MySQLLog.cpp | |
+1 −1 | src/C++/PostgreSQLLog.cpp |
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 |
---|---|---|
|
@@ -11,3 +11,5 @@ cmake = "0.1.50" | |
[features] | ||
default = [] | ||
print-ex = [] | ||
build-with-mysql = [] | ||
build-with-postgres = [] |
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
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,30 @@ | ||
use quickfix_ffi::{ | ||
FixMessageStoreFactory_delete, FixMessageStoreFactory_t, FixMysqlMessageStoreFactory_new, | ||
}; | ||
|
||
use crate::{FfiMessageStoreFactory, QuickFixError, SessionSettings}; | ||
|
||
/// MySQL based implementation of `MessageStore`. | ||
#[derive(Debug)] | ||
pub struct MySqlMessageStoreFactory(FixMessageStoreFactory_t); | ||
|
||
impl MySqlMessageStoreFactory { | ||
/// Try to create new struct from settings. | ||
pub fn try_new(settings: &SessionSettings) -> Result<Self, QuickFixError> { | ||
unsafe { FixMysqlMessageStoreFactory_new(settings.0) } | ||
.map(Self) | ||
.ok_or(QuickFixError::NullFunctionReturn) | ||
} | ||
} | ||
|
||
impl FfiMessageStoreFactory for MySqlMessageStoreFactory { | ||
fn as_ffi_ptr(&self) -> FixMessageStoreFactory_t { | ||
self.0 | ||
} | ||
} | ||
|
||
impl Drop for MySqlMessageStoreFactory { | ||
fn drop(&mut self) { | ||
unsafe { FixMessageStoreFactory_delete(self.0) } | ||
} | ||
} |
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,30 @@ | ||
use quickfix_ffi::{ | ||
FixMessageStoreFactory_delete, FixMessageStoreFactory_t, FixPostgresMessageStoreFactory_new, | ||
}; | ||
|
||
use crate::{FfiMessageStoreFactory, QuickFixError, SessionSettings}; | ||
|
||
/// PostgreSQL based implementation of `MessageStore`. | ||
#[derive(Debug)] | ||
pub struct PostgresMessageStoreFactory(FixMessageStoreFactory_t); | ||
|
||
impl PostgresMessageStoreFactory { | ||
/// Try to create new struct from settings. | ||
pub fn try_new(settings: &SessionSettings) -> Result<Self, QuickFixError> { | ||
unsafe { FixPostgresMessageStoreFactory_new(settings.0) } | ||
.map(Self) | ||
.ok_or(QuickFixError::NullFunctionReturn) | ||
} | ||
} | ||
|
||
impl FfiMessageStoreFactory for PostgresMessageStoreFactory { | ||
fn as_ffi_ptr(&self) -> FixMessageStoreFactory_t { | ||
self.0 | ||
} | ||
} | ||
|
||
impl Drop for PostgresMessageStoreFactory { | ||
fn drop(&mut self) { | ||
unsafe { FixMessageStoreFactory_delete(self.0) } | ||
} | ||
} |
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.