Skip to content

Commit 6042976

Browse files
author
Dale Wilson
committed
merged local changes
2 parents 7284061 + 70fa11e commit 6042976

21 files changed

+298
-84
lines changed

.hgignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ testdata
1212
s\.cmd
1313
cle\.cmd
1414
commit\.cmd
15+
^.+\.o$
16+
^.+\.so$
17+
\/\.depend\..+
18+
\/Makefile.*
19+
^bin

ChangeLog

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,59 @@ Mon Jan 21 21:50:25 UTC 2013 Dale Wilson <[email protected]>
2020
missing includes[Issue 112]
2121
Pass identity by reference not value in FieldSet
2222

23+
Mon Jun 3 22:30:25 UTC 2013 schmitzj <[email protected]>
24+
* setup.sh:
25+
Don't overwrite environment variables
2326

2427
Tue Jul 03 19:42:31 UTC 2012 Dale Wilson <[email protected]>
2528
Respond to messages on QuickFAST list.
29+
* src/Messages/FieldSet.cpp:
30+
* src/Messages/FieldSet.h:
31+
* src/Tests/testReplaceField.cpp:
32+
Allow replacement of a field.
33+
34+
* src/Messages/Sequence.h:
35+
Make constrctor accpept const field ref.
36+
37+
Thu May 30 22:30:25 UTC 2013 martinezm <[email protected]>
38+
* QuickFAST.mwc:
39+
Add Release and Debug configurations to makefiles.
40+
41+
* src/Examples/InterpretApplication/InterpretApplication.cpp:
42+
Build clean(er) with gcc 4.5.
43+
44+
* src/QuickFAST.mpc:
45+
Removed redundant include settings.
46+
47+
Fri May 3 16:52:46 UTC 2013 Brian Johnson <[email protected]>
48+
49+
* src\Common\AtomicOps.h
50+
Added CAS function for long longs.
51+
* src\Communication\AsynchFileSender.cpp
52+
* src\Communication\AsynchFileSender.h
53+
Changed to maintain a long long offset in the file to be able to
54+
write files greater than 4GB.
55+
56+
Thu May 2 9:20:23 UTC 2013 Brian Johnson <[email protected]>
57+
58+
* src/QuickFAST.mpc
59+
Reverted xerces changes.
60+
61+
Wed May 1 13:31:05 UTC 2013 Brian Johnson <[email protected]>
62+
63+
* .hgignore
64+
Added make and gcc build artifacts to ignore.
65+
* src/QuickFAST.mpc
66+
Changed to use xerces.mpb.
67+
68+
Wed May 1 12:24:31 UTC 2013 Brian Johnson <[email protected]>
69+
70+
* src/Codecs/Context.h
71+
* src/Messages/MessageFormatter.h
72+
* src/Messages/ValueMessageBuilder.h
73+
Added needed dependencies after files were moved.
74+
* src/Tests/testErrorRecovery.cpp
75+
Added needed dependency and fixed reinterpret_cast calls.
2676

2777
Tue Mar 20 19:39:29 UTC 2012 Dale Wilson <[email protected]>
2878
* .hgignore:

QuickFAST.features

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// This file defines MPC features used to enable and disable portions of the build
55
QuickFAST=1
66
boost=1
7+
// for Xerces 3.x.x set xerces3=1 and xerces2=0
8+
// for Xerces 2.x.x set xerces2=1 and xerces3=0
9+
xerces3=1
10+
xerces2=0
711

812
// Build .NET library
913
// To enable .NET build, change the following from '0' to '1'

QuickFAST.mwc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ workspace(*) {
22
cmdline += -feature_file QuickFAST.features
33
src/QuickFAST.mpc
44
src/Examples/Examples.mpc
5-
5+
6+
specific(make) {
7+
cmdline += -value_template "configurations=Release Debug"
8+
}
9+
610
// .NET support only for Visual Studio compilers
711
// exclude(!vc8,!vc9) [was not working so instead...
812
// .Net support only on windows

setup.cmd

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ REM Setting up QuickFAST environment
1818
REM =====================================================================================
1919
REM EDIT THE FOLLOWING LINES OR SET THESE VALUES IN YOUR ENVIRONMENT BEFORE RUNNING SETUP
2020
if "a" == "a%MPC_ROOT%" set MPC_ROOT=c:\MPC
21-
if "a" == "a%XERCES_ROOT%" set XERCES_ROOT=C:\Progs\xerces-c-3.0.1-x86-windows-vc-9.0
22-
if "a" == "a%XERCES_LIBNAME%" set XERCES_LIBNAME=xerces-c_3
21+
if "a" == "a%XERCESCROOT%" set XERCESCROOT=C:\Progs\xerces-c-3.0.1-x86-windows-vc-9.0
2322
if "a" == "a%BOOST_VERSION%" set BOOST_VERSION=boost_1_43_0
2423
if "a" == "a%BOOST_ROOT%" set BOOST_ROOT=c:\boost\%BOOST_VERSION%
2524
REM END OF VALUES TO BE SET
@@ -33,8 +32,8 @@ REM Verify setup by checking for expected files/directories
3332
set SETUP_CHECKING=MPC_ROOT=%MPC_ROOT%
3433
if not exist "%MPC_ROOT%\mpc.pl" goto setup_is_bad
3534

36-
set SETUP_CHECKING=XERCES_ROOT=%XERCES_ROOT%
37-
if not exist "%XERCES_ROOT%\lib" goto setup_is_bad
35+
set SETUP_CHECKING=XERCESCROOT=%XERCESCROOT%
36+
if not exist "%XERCESCROOT%\lib" goto setup_is_bad
3837

3938
set SETUP_CHECKING=BOOST_ROOT=%BOOST_ROOT%
4039
if not exist "%BOOST_ROOT%\boost" goto setup_is_bad
@@ -66,8 +65,7 @@ goto end
6665
:setup_is_ok
6766
set SETUP_CHECKING=
6867

69-
set XERCES_LIBPATH=%XERCES_ROOT%\lib
70-
set XERCES_INCLUDE=%XERCES_ROOT%\include
68+
set XERCESLIB=%XERCESCROOT%\lib
7169
set QUICKFAST_ROOT=%CD%
7270

7371
rem must be outside the if because of the parens in the directory name [what was microsoft thinking?]
@@ -94,10 +92,10 @@ REM: This avoids growing PATH and INCLUDE every time setup is run
9492
if "a" == "a%BASE_PATH%" set BASE_PATH=%PATH%
9593
if "a" == "a%BASE_INCLUDE%" set BASE_INCLUDE=%INCLUDE%
9694

97-
set RELEASE_PATH=%QUICKFAST_ROOT%\bin;%QUICKFAST_ROOT%\Output\Release;%MPC_ROOT%;%BOOST_ROOT%\lib;%QUICKFAST_ROOT%\lib;%XERCES_ROOT%\bin;%BASE_PATH%
98-
set DEBUG_PATH=%QUICKFAST_ROOT%\bin;%QUICKFAST_ROOT%\Output\Debug;%MPC_ROOT%;%BOOST_ROOT%\lib;%QUICKFAST_ROOT%\lib;%XERCES_ROOT%\bin;%BASE_PATH%
95+
set RELEASE_PATH=%QUICKFAST_ROOT%\bin;%QUICKFAST_ROOT%\Output\Release;%MPC_ROOT%;%BOOST_ROOT%\lib;%QUICKFAST_ROOT%\lib;%XERCESCROOT%\bin;%BASE_PATH%
96+
set DEBUG_PATH=%QUICKFAST_ROOT%\bin;%QUICKFAST_ROOT%\Output\Debug;%MPC_ROOT%;%BOOST_ROOT%\lib;%QUICKFAST_ROOT%\lib;%XERCESCROOT%\bin;%BASE_PATH%
9997
set PATH=%DEBUG_PATH%
100-
set INCLUDE=%BOOST_ROOT%;%XERCES_ROOT%\include;%BASE_INCLUDE%
98+
set INCLUDE=%BOOST_ROOT%;%XERCESCROOT%\include;%BASE_INCLUDE%
10199

102100
title QuickFAST
103101
:end

setup.sh

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,55 @@
33
# QuickFAST depends on BOOST V 1.36.0 or later. (http://www.boost.org/)
44
# QuickFAST depends on Xerces V3.0 or later. (http://xerces.apache.org/xerces-c/)
55
# Customize this file by setting variables to suit your environment
6-
export QUICKFAST_ROOT=`pwd`
6+
SOURCE="${BASH_SOURCE[0]}"
7+
SOURCE_DIR=`dirname $SOURCE`
8+
export QUICKFAST_ROOT=`readlink -f $SOURCE_DIR`
79

8-
export MPC_ROOT=~/MPC
10+
if test "$MPC_ROOT" = ""
11+
then
12+
export MPC_ROOT=~/MPC
13+
fi
914

10-
export BOOST_ROOT=~/boost/boost_1_38_0
11-
export BOOST_ROOT_LIB=$BOOST_ROOT/lib
12-
export BOOST_CFG=-gcc41-mt
13-
export BOOST_VERSION=boost-1_38
14-
export XERCES_ROOT=~/xerces/xerces-c-3.0.1
15-
export XERCES_LIBPATH=$XERCES_ROOT/src/.libs
16-
export XERCES_LIBNAME=xerces-c-3.0
17-
export XERCES_INCLUDE=$XERCES_ROOT/src
15+
if test "$BOOST_ROOT" = ""
16+
then
17+
export BOOST_ROOT=~/boost/boost_1_38_0
18+
fi
1819

20+
if test "$BOOST_ROOT_LIB" = ""
21+
then
22+
export BOOST_ROOT_LIB=$BOOST_ROOT/lib
23+
fi
24+
25+
if test "$BOOST_CFG" = ""
26+
then
27+
export BOOST_CFG=-gcc41-mt
28+
fi
29+
30+
if test "$BOOST_VERSION" = ""
31+
then
32+
export BOOST_VERSION=boost-1_38
33+
fi
34+
35+
if test "$XERCES_ROOT" = ""
36+
then
37+
export XERCES_ROOT=~/xerces/xerces-c-3.0.1
38+
fi
39+
40+
if test "$XERCES_LIBPATH" = ""
41+
then
42+
export XERCES_LIBPATH=$XERCES_ROOT/src/.libs
43+
fi
44+
45+
if test "$XERCES_LIBNAME" = ""
46+
then
47+
export XERCES_LIBNAME=xerces-c-3.0
48+
fi
49+
50+
if test "$XERCES_INCLUDE" = ""
51+
then
52+
export XERCES_INCLUDE=$XERCES_ROOT/src
53+
fi
1954

2055
export PATH=$QUICKFAST_ROOT/bin:$MPC_ROOT:$PATH
21-
export LD_LIBRARY_PATH=$XERCES_LIBPATH:$QUICKFAST_ROOT/lib:$BOOST_ROOT_LIB:$LD_LIBRARY_PATH
56+
export LD_LIBRARY_PATH=$XERCESLIB:$QUICKFAST_ROOT/lib:$BOOST_ROOT_LIB:$LD_LIBRARY_PATH
57+

src/Codecs/Context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#endif
77
#ifndef CONTEXT_H
88
#define CONTEXT_H
9+
#include <Common/QuickFASTPch.h>
910
#include <Common/QuickFAST_Export.h>
1011
#include <Common/Types.h>
1112
#include <Common/Value.h>

src/Common/AtomicOps.h

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
// Copyright (c) 2009, 2010, 2011 Object Computing, Inc.
1+
// Copyright (c) 2009, Object Computing, Inc.
22
// All rights reserved.
33
// See the file license.txt for licensing information.
44
//
5-
#ifdef _MSC_VER
6-
# pragma once
7-
#endif
85
#ifndef ATOMICOPS_H
96
#define ATOMICOPS_H
107

118
// This header defines functions to execute atomic operations inline
129

1310
#if defined(_WIN32)
1411
# include "windows.h"
12+
# include <intrin.h>
1513
# if defined(_MSC_VER)
1614
# pragma intrinsic(_InterlockedCompareExchange)
15+
# pragma intrinsic(_InterlockedCompareExchange64)
1716
// No intrinsic compare and swap pointer so we asm it below
1817
# endif
1918
#elif defined(__GNUC__)
@@ -157,5 +156,23 @@ namespace QuickFAST
157156
#endif
158157
}
159158

159+
/// @brief compare and swap long longs
160+
///
161+
/// @param target the long long to be updated
162+
/// @param ifeq the expected value before updating
163+
/// @param value the new value to be stored in target
164+
inline
165+
bool CASLongLong(long long volatile * target, long long ifeq, long long value)
166+
{
167+
#if defined(_WIN32)
168+
// Intel 486 and earlier not supported
169+
return ifeq == _InterlockedCompareExchange64(target, value, ifeq);
170+
#elif defined(__GNUC__)
171+
return __sync_bool_compare_and_swap(target, ifeq, value);
172+
#else
173+
return ifeq == atomic_cas_ulong(target, ifeq, value);
174+
#endif
175+
}
176+
160177
}
161178
#endif // ATOMICOPS_H

src/Common/Version.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ namespace QuickFAST
1212
{
1313
/// @brief Product information about QuickFAST
1414
const char QuickFAST_Product[] = "QuickFAST Version "
15-
"1.4.01"
16-
" (prerelease)"
15+
"1.5.0"
1716
"\n"
18-
"Copyright (c) 2009, 2010, 2011 Object Computing, Inc.\n"
17+
"Copyright (c) 2009, 2010, 2011, 2012, 2013 Object Computing, Inc.\n"
1918
"All Rights Reserved\n"
2019
"See the file license.txt for licensing information.\n";
2120
/// @brief version number
22-
const long QuickFAST_Version = 0x00010401; // MMMM.mmpp {M=Major, m=minor, p=patch)
21+
const long QuickFAST_Version = 0x00010500; // MMMM.mmpp {M=Major, m=minor, p=patch)
2322
}
2423
#endif // VERSION_H

src/Communication/AsynchFileSender.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,19 @@ AsynchFileSender::open()
7070
void
7171
AsynchFileSender::send(LinkedBuffer * buffer)
7272
{
73-
size_t bytesToWrite = buffer->used();
74-
long pos = offset_;
75-
while(!CASLong(&offset_, pos, pos + bytesToWrite))
73+
const size_t bytesToWrite = buffer->used();
74+
long long pos = offset_;
75+
while(!CASLongLong(&offset_, pos, pos + bytesToWrite))
7676
{
7777
pos = offset_;
7878
}
79-
sendAt(buffer, (size_t)pos);
79+
sendAt(buffer, pos);
8080
}
8181

8282
void
83-
AsynchFileSender::sendAt(LinkedBuffer * buffer, size_t offset)
83+
AsynchFileSender::sendAt(LinkedBuffer * buffer, long long offset)
8484
{
85-
size_t bytesToWrite = buffer->used();
85+
const size_t bytesToWrite = buffer->used();
8686
if(bytesToWrite > 0)
8787
{
8888
#if 0

src/Communication/AsynchFileSender.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// All rights reserved.
33
// See the file license.txt for licensing information.
44
//
5-
#ifdef _MSC_VER
6-
# pragma once
7-
#endif
85
#ifndef ASYNCHFILESENDER_H
96
#define ASYNCHFILESENDER_H
107
#include <Common/QuickFAST_Export.h>
@@ -58,7 +55,7 @@ namespace QuickFAST
5855
/// started in a multithreaded environment. By allowing the caller to
5956
/// specify an offset, this method give the caller control over the order
6057
/// of data in the file.
61-
void sendAt(LinkedBuffer * buffer, size_t offset);
58+
void sendAt(LinkedBuffer * buffer, long long offset);
6259

6360
// Override Sender method
6461
virtual void close();
@@ -67,7 +64,7 @@ namespace QuickFAST
6764
private:
6865
uint32 additionalAttributes_; // consider: FILE_FLAG_NO_BUFFERING
6966
boost::asio::windows::random_access_handle handle_;
70-
long volatile offset_;
67+
long long volatile offset_;
7168
};
7269
#endif // _WIN32
7370
}

src/Communication/BufferedRawFileReceiver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ namespace QuickFAST
3333
std::streamoff startPosition = stream.tellg();
3434
stream.seekg(0, std::ios_base::end);
3535
std::streamoff endPosition = stream.tellg();
36-
size_ = endPosition - startPosition;
36+
size_ = (size_t)(endPosition - startPosition);
3737
if(size_ > 0)
3838
{
39-
buffer_.reset(new unsigned char[endPosition - startPosition]);
39+
buffer_.reset(new unsigned char[(unsigned int)(endPosition - startPosition)]);
4040
stream.seekg(startPosition);
4141
stream.read(reinterpret_cast<char *>(buffer_.get()), size_);
4242
size_t read = (size_t) stream.gcount();

src/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PROJECT_NAME = QuickFAST
3131
# This could be handy for archiving the generated documentation or
3232
# if some version control system is used.
3333

34-
PROJECT_NUMBER = 1.4
34+
PROJECT_NUMBER = 1.5
3535

3636
# Using the PROJECT_BRIEF tag one can provide an optional one line description
3737
# for a project that appears at the top of each page and should give viewer

src/Examples/InterpretApplication/InterpretApplication.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
#include <Examples/MessageInterpreter.h>
1313
#include <Examples/ValueToFix.h>
1414

15+
namespace {
16+
template< typename T>
17+
void ignore_returnvalue(const T&) { }
18+
}
19+
1520
using namespace QuickFAST;
1621
using namespace Examples;
1722

@@ -256,7 +261,7 @@ InterpretApplication::run()
256261
size_t fileSize = std::ftell(bufferFile);
257262
std::fseek(bufferFile, 0, SEEK_SET);
258263
boost::scoped_array<unsigned char> buffer(new unsigned char[fileSize]);
259-
std::fread(buffer.get(), 1, fileSize, bufferFile);
264+
ignore_returnvalue( std::fread(buffer.get(), 1, fileSize, bufferFile));
260265
pConnection->receiver().receiveBuffer(buffer.get(), fileSize);
261266
}
262267
else

src/Messages/FieldSet.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,24 @@ FieldSet::addField(const FieldIdentity & identity, const FieldCPtr & value)
102102
++used_;
103103
}
104104

105+
bool
106+
FieldSet::replaceField(const FieldIdentityCPtr & identity,
107+
const FieldCPtr & value)
108+
{
109+
for(size_t index = 0; index < used_; ++index)
110+
{
111+
if(identity == fields_[index].getIdentity())
112+
{
113+
if(fields_[index].getField()->isDefined()) {
114+
(fields_ + index)->~MessageField(); // Explicit destroy
115+
new (fields_ + index) MessageField(identity, value);
116+
return true;
117+
}
118+
}
119+
}
120+
return false;
121+
}
122+
105123
bool
106124
FieldSet::getField(const Messages::FieldIdentity & identity, FieldCPtr & value) const
107125
{

0 commit comments

Comments
 (0)