[
https://issues.apache.org/jira/browse/QPID-1338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Steve Huston updated QPID-1338:
-------------------------------
Attachment: broker.diff
The attached broker.diff gets the remaining piece of platform-specific broker
code split out. This is done a bit differently in that platform-specific code
from cpp/src/qpidd.cpp is split into cpp/src/qpidd_posix.cpp rather than make
another directory. This is for two reasons:
1. There's only one file. Seems a bit overkill to make a new directory for one
file.
2. The CONF_FILE and MODULE_DIR macros are currently set on the compiler's
command-line options with different values for qpidd and libqpidclient. Simply
adding one more file to qpidd's sources keeps this arrangement.
Any feedback is welcome. I would like this to go in M4 if at all possible.
> Allow multiple platforms differences in C++ broker, client code
> ---------------------------------------------------------------
>
> Key: QPID-1338
> URL: https://issues.apache.org/jira/browse/QPID-1338
> Project: Qpid
> Issue Type: Improvement
> Components: C++ Broker, C++ Client
> Reporter: Steve Huston
> Priority: Minor
> Attachments: broker.diff
>
>
> This is in the context of adding Windows support to the C++ broker and
> client. There are currently 3 places where platform differences may arise:
> 1. Broker code (cpp/src/qpid/broker)
> 2. Client code (cpp/src/qpid/client)
> 3. Supporting code which may be common to both (cpp/src/qpid/sys)
> The current general approach as I've been advised and encouraged by Andrew
> Stitcher, primarily while working on the supporting (cpp/src/qpid/sys) level
> code such as the I/O system is to define a common interface in a header file
> (such as in cpp/src/qpid/sys) and then implement the class(es) differently in
> platform-specific sources which reside in cpp/src/qpid/sys/posix,
> cpp/src/qpid/sys/windows. This has been working well.
> The other two places, however, cpp/src/qpid/broker and cpp/src/qpid/client,
> don't current have platform-specific subdirectories since to this point, all
> the platform differences have successfully been pushed down to
> cpp/src/qpid/sys. However, adding a platform quite different from Linux has
> forced this issue up a level and we now need to come up with a way to handle
> platform differences at the broker and client level. This is arising in 2
> different types of situations:
> 1. Areas such as logging classes, where the options and capabilities are not
> the same across platforms. For example, syslog doesn't make sense on Windows,
> where logging to the event log would. Simply equating the two doesn't work
> since there are different related options. Many options are common. Broker
> authentication is another area - Windows doesn't provide Cyrus sasl - it uses
> other functions.
> 2. Situations where the features are the same, but in order to bring in
> platform different code at the I/O layer, a source file is copied and edited
> slightly to bring in a different lower layer. This is the situation in the
> client where the Connector.cpp is copied to WinConnector.cpp to bring in the
> Windows asynch I/O code.
> Up to now the approach has been this:
> - When doing something platform-dependent in cpp/src/qpid/sys, add platform
> diffs in cpp/src/qpid/sys/<platform>
> - When doing something platform-dependent in cpp/src/qpid/log, add platform
> diffs in cpp/src/qpid/log/<platform>
> - When doing something platform-dependent in cpp/src/qpid/broker, or
> cpp/src/qpid/client, use a file name of the form <platform>File.cpp
> Would it be more appropriate to create platform-specific directories under
> cpp/src/qpid/broker and .../client? Or stick with the current method? I favor
> the new directories, but am open to ideas.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.