Skip to content

Commit 029061b

Browse files
committed
[C++]: fix code generator so build works. Add Agrona 0.4 dependency. Clean up README.
1 parent 60d68dc commit 029061b

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
Simple Binary Encoding (SBE)
22
============================
33

4-
[SBE](http://www.fixtradingcommunity.org/pg/file/fplpo/read/1196757/simple-binary-encoding-release-candidate-2) is OSI layer 6 presentation for encoding and decoding application messages in binary format for low-latency applications.
4+
[SBE](http://www.fixtradingcommunity.org/pg/file/fplpo/read/1196757/simple-binary-encoding-release-candidate-2) is
5+
OSI layer 6 presentation for encoding and decoding application messages in binary format for low-latency applications.
56

6-
Further details on the background and usage of SBE can be found on the [Wiki](https://github.com/real-logic/simple-binary-encoding/wiki).
7+
Further details on the background and usage of SBE can be found on the
8+
[Wiki](https://github.com/real-logic/simple-binary-encoding/wiki).
79

8-
Benchmark tools and information can be found [here](https://github.com/real-logic/simple-binary-encoding/tree/master/perf) and run from he root perf-build.xml file.
10+
Benchmark tools and information can be found [here](https://github.com/real-logic/simple-binary-encoding/tree/master/perf)
11+
and run from he root perf-build.xml file.
912

10-
An XSD for SBE specs can be found [here](https://github.com/real-logic/simple-binary-encoding/blob/master/main/resources/fpl/SimpleBinary1-0.xsd)
13+
An XSD for SBE specs can be found
14+
[here](https://github.com/real-logic/simple-binary-encoding/blob/master/main/resources/fpl/SimpleBinary1-0.xsd)
1115

1216
License (See LICENSE file for full license)
1317
-------------------------------------------
@@ -28,15 +32,16 @@ limitations under the License.
2832
Binaries
2933
--------
3034

31-
Binaries and dependency information for Maven, Ivy, Gradle, and others can be found at [http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22uk.co.real-logic%22%20AND%20a%3A%22sbe%22).
35+
Binaries and dependency information for Maven, Ivy, Gradle, and others can be found at
36+
[http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22uk.co.real-logic%22%20AND%20a%3A%22sbe%22).
3237

3338
Example for Maven:
3439

3540
```xml
3641
<dependency>
3742
    <groupId>uk.co.real-logic</groupId>
3843
    <artifactId>sbe</artifactId>
39-
    <version>1.0-RC2</version>
44+
    <version>1.1-RC2</version>
4045
</dependency>
4146
```
4247

@@ -102,14 +107,15 @@ Android jars for the codec, source, and javadoc can be found in
102107
C++ Build using CMake
103108
---------------------
104109

105-
NOTE: Linux, Mac OS, and Windows only for the moment. See [FAQ](https://github.com/real-logic/simple-binary-encoding/wiki/Frequently-Asked-Questions).
110+
NOTE: Linux, Mac OS, and Windows only for the moment. See
111+
[FAQ](https://github.com/real-logic/simple-binary-encoding/wiki/Frequently-Asked-Questions).
106112
Windows builds have been tested with Visual Studio Express 12.
107113

108114
First build using gradle to generate the SBE jar.
109115

110116
$ ./gradlew
111117

112-
Then build and test with CMake in the build subdirectory created by the gradle build.
118+
Then build and test with CMake __in the build subdirectory created by the gradle build__.
113119

114120
$ cd build
115121
$ cmake ..

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ sourceSets {
7373
}
7474

7575
dependencies {
76-
compile 'uk.co.real-logic:Agrona:0.3.1'
76+
compile 'uk.co.real-logic:Agrona:0.4'
7777

7878
testCompile 'org.hamcrest:hamcrest-all:1.3',
7979
'junit:junit:4.12',

main/java/uk/co/real_logic/sbe/generation/cpp98/Cpp98Generator.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,16 @@ public Cpp98Generator(final Ir ir, final OutputManager outputManager)
5050

5151
public void generateMessageHeaderStub() throws IOException
5252
{
53-
try (final Writer out = outputManager.createOutput(MESSAGE_HEADER_ENCODER_TYPE))
53+
final String messageHeader = "MessageHeader";
54+
55+
try (final Writer out = outputManager.createOutput(messageHeader))
5456
{
5557
final List<Token> tokens = ir.headerStructure().tokens();
56-
out.append(generateFileHeader(ir.applicableNamespace().replace('.', '_'), MESSAGE_HEADER_ENCODER_TYPE, null));
57-
out.append(generateClassDeclaration(MESSAGE_HEADER_ENCODER_TYPE));
58-
out.append(generateFixedFlyweightCode(MESSAGE_HEADER_ENCODER_TYPE, tokens.get(0).encodedLength()));
58+
out.append(generateFileHeader(ir.applicableNamespace().replace('.', '_'), messageHeader, null));
59+
out.append(generateClassDeclaration(messageHeader));
60+
out.append(generateFixedFlyweightCode(messageHeader, tokens.get(0).encodedLength()));
5961
out.append(generatePrimitivePropertyEncodings(
60-
MESSAGE_HEADER_ENCODER_TYPE, tokens.subList(1, tokens.size() - 1), BASE_INDENT));
62+
messageHeader, tokens.subList(1, tokens.size() - 1), BASE_INDENT));
6163

6264
out.append("};\n}\n#endif\n");
6365
}

0 commit comments

Comments
 (0)