[
https://issues.apache.org/jira/browse/QPID-1338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643627#action_12643627
]
Steve Huston commented on QPID-1338:
------------------------------------
Thanks for the feedback, Alan.
I created qpid/cpp/src/posix and windows directories to make things consistent
with the other places platform-specific code is placed.
This is committed in svn revision 708991.
Re some of your specific comments:
- The general background process abstraction does exist in sys::Daemon - the
posix broker code is derived from it to add the specific parent/child
processing. On Windows there is no fork(), so this type of child/parent doesn't
exist.
- The logging differences are factored out... I could be unclear on what a
"plugin" means... I think of it as a separate dll/lib that gets loaded at
runtime. The logging isn't structured like that for posix/windows, but there
are different specific sets of options that are brought in at compile time.
- I agree that same/similar functionality exists it should be common (even if
implemented differently). The example of a Windows service, though, is probably
not in this category, but I agree with the premise.
So I think we're in good shape here for M4, but if you think more needs to be
addressed for M4, please let me know.
Thanks,
-Steve
> 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
> Affects Versions: M4
> 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.