Skip to content

Commit

Permalink
Remove unnecessary calls to parseCommandLineOptions (#2959)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Oct 23, 2024
1 parent ca22bd3 commit b7946f7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 87 deletions.
83 changes: 0 additions & 83 deletions cpp/include/DataStorm/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,80 +46,6 @@ namespace DataStorm
*/
Node(Ice::CommunicatorPtr communicator);

/**
* Construct a DataStorm node.
*
* A node is the main DataStorm object. It is required to construct topics. This constructor parses the
* command line arguments into Ice properties and initialize a new Node. The constructor initializes the
* Ice communicator using the given Ice arguments. If the communicator creation fails, an Ice exception is
* raised.
*
* @param argc The number of command line arguments in the argv array.
* @param argv The command line arguments.
* @param iceArgs Additional arguments which are passed to the Ice::initialize function in addition to the
* argc and argv arguments.
*/
template<class... T> Node(int& argc, const char* argv[], T&&... iceArgs) : _ownsCommunicator(true)
{
init(argc, argv, std::forward<T>(iceArgs)...);
}

/**
* Construct a DataStorm node.
*
* A node is the main DataStorm object. It is required to construct topics. This constructor parses the
* command line arguments into Ice properties and initialize a new Node. The constructor initializes the
* Ice communicator using the given Ice arguments. If the communicator creation fails, an Ice exception is
* raised.
*
* @param argc The number of command line arguments in the argv array.
* @param argv The command line arguments.
* @param iceArgs Additional arguments which are passed to the Ice::initialize function in addition to the
* argc and argv arguments.
*/
template<class... T> Node(int& argc, char* argv[], T&&... iceArgs) : _ownsCommunicator(true)
{
init(argc, argv, std::forward<T>(iceArgs)...);
}

#ifdef _WIN32
/**
* Construct a DataStorm node.
*
* A node is the main DataStorm object. It is required to construct topics. This constructor parses the
* command line arguments into Ice properties and initialize a new Node. The constructor initializes the
* Ice communicator using the given Ice arguments. If the communicator creation fails, an Ice exception is
* raised.
*
* @param argc The number of command line arguments in the argv array.
* @param argv The command line arguments.
* @param iceArgs Additional arguments which are passed to the Ice::initialize function in addition to the
* argc and argv arguments.
*/
template<class... T> Node(int& argc, const wchar_t* argv[], T&&... iceArgs) : _ownsCommunicator(true)
{
init(argc, argv, std::forward<T>(iceArgs)...);
}

/**
* Construct a DataStorm node.
*
* A node is the main DataStorm object. It is required to construct topics. This constructor parses the
* command line arguments into Ice properties and initialize a new Node. The constructor initializes the
* Ice communicator using the given Ice arguments. If the communicator creation fails, an Ice exception is
* raised.
*
* @param argc The number of command line arguments in the argv array.
* @param argv The command line arguments.
* @param iceArgs Additional arguments which are passed to the Ice::initialize function in addition to the
* argc and argv arguments.
*/
template<class... T> Node(int& argc, wchar_t* argv[], T&&... iceArgs) : _ownsCommunicator(true)
{
init(argc, argv, std::forward<T>(iceArgs)...);
}
#endif

/**
* Construct a DataStorm node.
*
Expand Down Expand Up @@ -187,15 +113,6 @@ namespace DataStorm
Ice::ConnectionPtr getSessionConnection(const std::string& ident) const noexcept;

private:
template<typename V, class... T> void init(int& argc, V argv, T&&... iceArgs)
{
auto communicator = Ice::initialize(argc, argv, std::forward<T>(iceArgs)...);
auto args = Ice::argsToStringSeq(argc, argv);
args = communicator->getProperties()->parseCommandLineOptions("DataStorm", args);
Ice::stringSeqToArgs(args, argc, argv);
init(communicator);
}

void init(const Ice::CommunicatorPtr&);

std::shared_ptr<DataStormI::Instance> _instance;
Expand Down
4 changes: 0 additions & 4 deletions cpp/src/IceBridge/IceBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,6 @@ BridgeService::initializeCommunicator(
InitializationData initData = initializationData;
initData.properties = createProperties(argc, argv, initializationData.properties);

StringSeq args = argsToStringSeq(argc, argv);
args = initData.properties->parseCommandLineOptions("IceBridge", args);
stringSeqToArgs(args, argc, argv);

//
// Disable automatic retry by default.
//
Expand Down

0 comments on commit b7946f7

Please sign in to comment.