-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlazingMQ C SDK Initial Pull Request #169
base: main
Are you sure you want to change the base?
Changes from 61 commits
3a34d45
27ce71d
5f79d23
9f2ff58
f662467
9190f2a
12fc043
031c034
ccfa5e6
0efcb02
c208895
9459753
63b54cf
1849c31
2ee34f7
e4e2c92
d21c924
0666ce9
a69e978
5a54f03
b079bf7
7011a61
572e38c
8e188c3
232222d
be3ef3f
29ee11e
02ef69c
3e1c44c
a45f417
78d60c8
e937346
e35c2f3
a24c1f8
d03af92
5493d19
cd3479e
f4bc2f9
0eb49cc
e1c2c8a
94dc4fd
5101116
c2e3856
7f492a6
1366de1
d7c657d
eb918c7
3e7c907
a6d0ffc
a234e0c
4962eca
982e168
bcd3028
5a7cb36
5325161
9a02d32
a0e317b
31aabe5
eef8012
7578194
2a0c76c
e5639c0
88adfad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ CMakeUserPresets.json | |
/include/ | ||
/lib/ | ||
**/__pycache__/ | ||
/thirdparty |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/Users/aaryaman/Documents/bmq/blazingmq/src/applications/bmqbrkr/etc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will need to be removed |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
add_subdirectory(mwc) | ||
add_subdirectory(bmq) | ||
add_subdirectory(mqb) | ||
add_subdirectory(wrappers/z_bmq) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The wrappers directory should be below |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,11 @@ | ||||
# bmq | ||||
# --- | ||||
|
||||
|
||||
# Add the libbmq group library only installing the public headers | ||||
add_library(z_bmq) | ||||
|
||||
target_compile_definitions(z_bmq PRIVATE "MWC_INTERNAL_USAGE") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I don't think this library should need internal usage of mwc to work |
||||
|
||||
target_bmq_style_uor( z_bmq ) | ||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,63 @@ | ||||||
z_bmq.txt | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This description needs updating |
||||||
|
||||||
@PURPOSE: Public SDK API for the BlazingMQ framework. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
@MNEMONIC: BlazingMQ (bmq) | ||||||
|
||||||
@DESCRIPTION: BlazingmQ (package group 'bmq') is a message-queue | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
framework allowing application developers to use reliable distributed queues. | ||||||
|
||||||
The 'bmqa' and 'bmqt' packages contain all components that constitute the | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
public API for BlazingmQ users to use. A client should only use the | ||||||
components in these packages, and should not use any other package under the | ||||||
'bmq' package group since they are implementation components that may change | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
at any time. | ||||||
|
||||||
/Hierarchical Synopsis | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please update the rest of the document to reflect |
||||||
/--------------------- | ||||||
The 'bmq' group library currently has 5 packages forming 5 levels of physical | ||||||
dependency. | ||||||
.. | ||||||
5. bmqa | ||||||
|
||||||
4. bmqimp | ||||||
|
||||||
3. bmqp | ||||||
|
||||||
2. bmqt | ||||||
|
||||||
1. bmqscm | ||||||
.. | ||||||
|
||||||
/Package Synopsis | ||||||
/------------------ | ||||||
: 'bmqa': | ||||||
: Provide applications public API for the BlazingmQ SDK. | ||||||
: | ||||||
: 'bmqimp': | ||||||
: [INTERNAL] Provide implementation for the API of the BlazingMQ SDK. | ||||||
: | ||||||
: 'bmqp': | ||||||
: [INTERNAL] Provide BlazingMQ protocol definition, builders and parsers. | ||||||
: | ||||||
: 'bmqscm': | ||||||
: Provide versioning information for library components in 'bmq'. | ||||||
: | ||||||
: 'bmqt': | ||||||
: Provide value-semantic vocabulary types. | ||||||
|
||||||
/Package Overview | ||||||
/---------------- | ||||||
The following provides a brief overview of several of the packages within the | ||||||
'bmq' package group, arranged in alphabetical order. The descriptions here | ||||||
are still very brief; see the respective Package Level documents for more | ||||||
details and usage examples. | ||||||
|
||||||
/'bmqa' | ||||||
/- - - | ||||||
'bmqa' provides the top-level public APIs application can use to interact with | ||||||
BlazingMQ framework in their applications. | ||||||
|
||||||
/'bmqt' | ||||||
/- - - | ||||||
'bmqt' provides value-semantic vocabulary types used in the {'bmqa'} APIs. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Level 2 | ||
bmq | ||
|
||
# Level 1 | ||
bsl |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# [OFFLINE ONLY] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the meaning of |
||
|
||
z_bmqa | ||
z_bmqt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mwc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing newline at end of file |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
prefix=/usr/local | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file shouldn't be necessary |
||
libdir=${prefix}//home/jon/cs/bb/simon-fork/blazingmq | ||
includedir=${prefix}/include | ||
|
||
Name: z-bmq | ||
Description: z_bmq | ||
Version: 0.0.0 | ||
Requires.private: bmq bsl | ||
Libs: -L${libdir} -lz_bmq | ||
Cflags: -I${includedir} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like an autogenerated file that shouldn't be in the source tree |
||
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### | ||
####### Any changes to this file will be overwritten by the next CMake run #### | ||
####### The input file was uorConfig.cmake.in ######## | ||
|
||
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../../../../../usr/local" ABSOLUTE) | ||
|
||
macro(set_and_check _var _file) | ||
set(${_var} "${_file}") | ||
if(NOT EXISTS "${_file}") | ||
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") | ||
endif() | ||
endmacro() | ||
|
||
macro(check_required_components _NAME) | ||
foreach(comp ${${_NAME}_FIND_COMPONENTS}) | ||
if(NOT ${_NAME}_${comp}_FOUND) | ||
if(${_NAME}_FIND_REQUIRED_${comp}) | ||
set(${_NAME}_FOUND FALSE) | ||
endif() | ||
endif() | ||
endforeach() | ||
endmacro() | ||
|
||
#################################################################################### | ||
|
||
include(CMakeFindDependencyMacro) | ||
|
||
if(NOT TARGET z_bmq) | ||
if(NOT WIN32) | ||
find_dependency(Threads) | ||
endif() | ||
|
||
foreach(dep bmq;bsl) | ||
find_dependency(${dep}) | ||
endforeach() | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/z_bmqTargets.cmake) | ||
endif() | ||
|
||
check_required_components(z_bmq) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
z_bmqt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing newline at end of file |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
z_bmqa_configurequeuestatus | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please sort the components in alphabetical order |
||
z_bmqa_confirmeventbuilder | ||
z_bmqa_closequeuestatus | ||
z_bmqa_event | ||
z_bmqa_message | ||
z_bmqa_messageevent | ||
z_bmqa_messageeventbuilder | ||
z_bmqa_messageiterator | ||
z_bmqa_messageproperties | ||
z_bmqa_queueid | ||
z_bmqa_session | ||
z_bmqa_sessionevent | ||
z_bmqa_openqueuestatus | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing newline at end of file |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,99 @@ | ||||||||||||
#include <bmqa_closequeuestatus.h> | ||||||||||||
#include <z_bmqa_closequeuestatus.h> | ||||||||||||
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Please put the header of the component as the first include |
||||||||||||
|
||||||||||||
int z_bmqa_CloseQueueStatus__delete(z_bmqa_CloseQueueStatus** status_obj) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
style, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This applies to all files, correct ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct |
||||||||||||
{ | ||||||||||||
using namespace BloombergLP; | ||||||||||||
|
||||||||||||
BSLS_ASSERT(status_obj != NULL); | ||||||||||||
|
||||||||||||
bmqa::CloseQueueStatus* status_p = | ||||||||||||
reinterpret_cast<bmqa::CloseQueueStatus*>(*status_obj); | ||||||||||||
delete status_p; | ||||||||||||
*status_obj = NULL; | ||||||||||||
|
||||||||||||
return 0; | ||||||||||||
} | ||||||||||||
|
||||||||||||
int z_bmqa_CloseQueueStatus__create(z_bmqa_CloseQueueStatus** status_obj) | ||||||||||||
{ | ||||||||||||
using namespace BloombergLP; | ||||||||||||
|
||||||||||||
bmqa::CloseQueueStatus* status_p = new bmqa::CloseQueueStatus(); | ||||||||||||
|
||||||||||||
*status_obj = reinterpret_cast<z_bmqa_CloseQueueStatus*>(status_p); | ||||||||||||
|
||||||||||||
return 0; | ||||||||||||
} | ||||||||||||
|
||||||||||||
int z_bmqa_CloseQueueStatus__createCopy(z_bmqa_CloseQueueStatus** status_obj, | ||||||||||||
const z_bmqa_CloseQueueStatus* other) | ||||||||||||
{ | ||||||||||||
using namespace BloombergLP; | ||||||||||||
|
||||||||||||
const bmqa::CloseQueueStatus* other_p = | ||||||||||||
reinterpret_cast<const bmqa::CloseQueueStatus*>(other); | ||||||||||||
bmqa::CloseQueueStatus* status_p = new bmqa::CloseQueueStatus(*other_p); | ||||||||||||
|
||||||||||||
*status_obj = reinterpret_cast<z_bmqa_CloseQueueStatus*>(status_p); | ||||||||||||
|
||||||||||||
return 0; | ||||||||||||
} | ||||||||||||
|
||||||||||||
int z_bmqa_CloseQueueStatus__createFull(z_bmqa_CloseQueueStatus** status_obj, | ||||||||||||
const z_bmqa_QueueId* queueId, | ||||||||||||
int result, | ||||||||||||
const char* errorDescription) | ||||||||||||
{ | ||||||||||||
using namespace BloombergLP; | ||||||||||||
|
||||||||||||
const bmqa::QueueId* queueId_p = reinterpret_cast<const bmqa::QueueId*>( | ||||||||||||
queueId); | ||||||||||||
const bsl::string errorDescription_str(errorDescription); | ||||||||||||
bmqt::CloseQueueResult::Enum result_enum = | ||||||||||||
static_cast<bmqt::CloseQueueResult::Enum>(result); | ||||||||||||
bmqa::CloseQueueStatus* status_p = new bmqa::CloseQueueStatus( | ||||||||||||
*queueId_p, | ||||||||||||
result_enum, | ||||||||||||
errorDescription_str); | ||||||||||||
*status_obj = reinterpret_cast<z_bmqa_CloseQueueStatus*>(status_p); | ||||||||||||
|
||||||||||||
return 0; | ||||||||||||
} | ||||||||||||
|
||||||||||||
bool z_bmqa_CloseQueueStatus__toBool(const z_bmqa_CloseQueueStatus* status_obj) | ||||||||||||
{ | ||||||||||||
using namespace BloombergLP; | ||||||||||||
const bmqa::CloseQueueStatus* status_p = | ||||||||||||
reinterpret_cast<const bmqa::CloseQueueStatus*>(status_obj); | ||||||||||||
return *status_p; | ||||||||||||
} | ||||||||||||
|
||||||||||||
int z_bmqa_CloseQueueStatus__queueId(const z_bmqa_CloseQueueStatus* status_obj, | ||||||||||||
z_bmqa_QueueId const** queueId_obj) | ||||||||||||
{ | ||||||||||||
using namespace BloombergLP; | ||||||||||||
const bmqa::CloseQueueStatus* status_p = | ||||||||||||
reinterpret_cast<const bmqa::CloseQueueStatus*>(status_obj); | ||||||||||||
const bmqa::QueueId* queueId_p = &(status_p->queueId()); | ||||||||||||
|
||||||||||||
*queueId_obj = reinterpret_cast<const z_bmqa_QueueId*>(queueId_p); | ||||||||||||
return 0; | ||||||||||||
} | ||||||||||||
|
||||||||||||
int z_bmqa_CloseQueueStatus__result(const z_bmqa_CloseQueueStatus* status_obj) | ||||||||||||
{ | ||||||||||||
using namespace BloombergLP; | ||||||||||||
const bmqa::CloseQueueStatus* status_p = | ||||||||||||
reinterpret_cast<const bmqa::CloseQueueStatus*>(status_obj); | ||||||||||||
return status_p->result(); | ||||||||||||
} | ||||||||||||
|
||||||||||||
const char* z_bmqa_CloseQueueStatus__errorDescription( | ||||||||||||
const z_bmqa_CloseQueueStatus* status_obj) | ||||||||||||
{ | ||||||||||||
using namespace BloombergLP; | ||||||||||||
const bmqa::CloseQueueStatus* status_p = | ||||||||||||
reinterpret_cast<const bmqa::CloseQueueStatus*>(status_obj); | ||||||||||||
return status_p->errorDescription().c_str(); | ||||||||||||
} | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing newline at end of file |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#ifndef INCLUDED_Z_BMQA_CLOSEQUEUESTATUS | ||
#define INCLUDED_Z_BMQA_CLOSEQUEUESTATUS | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdbool.h> | ||
#include <z_bmqa_queueid.h> | ||
|
||
typedef struct z_bmqa_CloseQueueStatus z_bmqa_CloseQueueStatus; | ||
|
||
/** | ||
* @brief Deletes the memory allocated for a pointer to a bmqa::CloseQueueStatus object. | ||
* | ||
* This function deallocates the memory pointed to by the input pointer to a bmqa::CloseQueueStatus object and sets the pointer to NULL. | ||
* | ||
* @param status_obj A pointer to a pointer to a bmqa::CloseQueueStatus object. | ||
* Upon successful completion, this pointer will be set to NULL. | ||
* @return Returns 0 upon successful deletion. | ||
*/ | ||
int z_bmqa_CloseQueueStatus__delete(z_bmqa_CloseQueueStatus** status_obj); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace |
||
|
||
/** | ||
* @brief Creates a new bmqa::CloseQueueStatus object. | ||
* | ||
* This function creates a new bmqa::CloseQueueStatus object and assigns its pointer to the provided pointer. | ||
* | ||
* @param status_obj A pointer to a pointer to a bmqa::CloseQueueStatus object. | ||
* Upon successful completion, this pointer will hold the newly created CloseQueueStatus object. | ||
* @return Returns 0 upon successful creation. | ||
*/ | ||
int z_bmqa_CloseQueueStatus__create(z_bmqa_CloseQueueStatus** status_obj); | ||
|
||
/** | ||
* @brief Creates a copy of a bmqa::CloseQueueStatus object. | ||
* | ||
* This function creates a copy of the specified bmqa::CloseQueueStatus object and assigns its pointer to the provided pointer. | ||
* | ||
* @param status_obj A pointer to a pointer to a bmqa::CloseQueueStatus object. | ||
* Upon successful completion, this pointer will hold the newly created copy of the CloseQueueStatus object. | ||
* @param other A pointer to a constant bmqa::CloseQueueStatus object to copy. | ||
* @return Returns 0 upon successful creation. | ||
*/ | ||
int z_bmqa_CloseQueueStatus__createCopy(z_bmqa_CloseQueueStatus** status_obj, | ||
const z_bmqa_CloseQueueStatus* other); | ||
|
||
/** | ||
* @brief Creates a bmqa::CloseQueueStatus object with specified parameters. | ||
* | ||
* This function creates a new bmqa::CloseQueueStatus object with the specified parameters and assigns its pointer to the provided pointer. | ||
* | ||
* @param status_obj A pointer to a pointer to a bmqa::CloseQueueStatus object. | ||
* Upon successful completion, this pointer will hold the newly created CloseQueueStatus object. | ||
* @param queueId A pointer to a constant z_bmqa_QueueId object representing the queue identifier. | ||
* @param result An integer representing the result of the close operation. | ||
* @param errorDescription A pointer to a constant character string representing the error description. | ||
* @return Returns 0 upon successful creation. | ||
*/ | ||
int z_bmqa_CloseQueueStatus__createFull(z_bmqa_CloseQueueStatus** status_obj, | ||
const z_bmqa_QueueId* queueId, | ||
int result, | ||
const char* errorDescription); | ||
|
||
/** | ||
* @brief Converts a CloseQueueStatus object to a boolean value. | ||
* | ||
* This function converts the specified CloseQueueStatus object to a boolean value. | ||
* | ||
* @param status_obj A pointer to a constant z_bmqa_CloseQueueStatus object to convert. | ||
* @return Returns true if the CloseQueueStatus object indicates success, false otherwise. | ||
*/ | ||
bool z_bmqa_CloseQueueStatus__toBool( | ||
const z_bmqa_CloseQueueStatus* status_obj); | ||
|
||
/** | ||
* @brief Retrieves the queue identifier from a CloseQueueStatus object. | ||
* | ||
* This function retrieves the queue identifier from the specified CloseQueueStatus object. | ||
* | ||
* @param status_obj A pointer to a constant z_bmqa_CloseQueueStatus object. | ||
* @param queueId_obj A pointer to a pointer to a constant z_bmqa_QueueId object. | ||
* Upon successful completion, this pointer will hold the queue identifier. | ||
* @return Returns 0 upon successful retrieval of the queue identifier. | ||
*/ | ||
int z_bmqa_CloseQueueStatus__queueId(const z_bmqa_CloseQueueStatus* status_obj, | ||
z_bmqa_QueueId const** queueId_obj); | ||
|
||
/** | ||
* @brief Retrieves the result of a close queue operation from a CloseQueueStatus object. | ||
* | ||
* This function retrieves the result of the close queue operation from the specified CloseQueueStatus object. | ||
* | ||
* @param status_obj A pointer to a constant z_bmqa_CloseQueueStatus object. | ||
* @return Returns an integer representing the result of the close queue operation. | ||
*/ | ||
int z_bmqa_CloseQueueStatus__result(const z_bmqa_CloseQueueStatus* status_obj); | ||
|
||
/** | ||
* @brief Retrieves the error description from a CloseQueueStatus object. | ||
* | ||
* This function retrieves the error description from the specified CloseQueueStatus object. | ||
* | ||
* @param status_obj A pointer to a constant z_bmqa_CloseQueueStatus object. | ||
* @return Returns a pointer to a constant character string representing the error description. | ||
*/ | ||
const char* z_bmqa_CloseQueueStatus__errorDescription( | ||
const z_bmqa_CloseQueueStatus* status_obj); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personal paths should not be committed.