Skip to content
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

Remove trailing int version in Ice::initialize and more #2985

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cpp/include/Ice/Communicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,9 @@ namespace Ice
IceInternal::ReferencePtr _stringToProxy(const std::string& str) const;
IceInternal::ReferencePtr _propertyToProxy(const std::string& property) const;

friend ICE_API CommunicatorPtr initialize(int&, const char*[], const InitializationData&, std::int32_t);
friend ICE_API CommunicatorPtr initialize(StringSeq&, const InitializationData&, std::int32_t);
friend ICE_API CommunicatorPtr initialize(const InitializationData&, std::int32_t);
friend ICE_API CommunicatorPtr initialize(int&, const char*[], const InitializationData&);
friend ICE_API CommunicatorPtr initialize(StringSeq&, const InitializationData&);
friend ICE_API CommunicatorPtr initialize(const InitializationData&);
friend ICE_API IceInternal::InstancePtr IceInternal::getInstance(const Ice::CommunicatorPtr&);
friend ICE_API IceInternal::TimerPtr IceInternal::getInstanceTimer(const Ice::CommunicatorPtr&);

Expand Down
67 changes: 16 additions & 51 deletions cpp/include/Ice/Initialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,12 @@ namespace Ice
* file and in the arguments, the arguments take precedence.
* Recognized options are removed from this vector upon return.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
ICE_API CommunicatorPtr initialize(
int& argc,
const char* argv[],
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION);
const InitializationData& initData = InitializationData());

/**
* Initializes a new communicator.
Expand All @@ -379,17 +376,14 @@ namespace Ice
* file and in the arguments, the arguments take precedence.
* Recognized options are removed from this vector upon return.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
inline CommunicatorPtr initialize(
int& argc,
char* argv[],
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION)
const InitializationData& initData = InitializationData())
{
return initialize(argc, const_cast<const char**>(argv), initData, version);
return initialize(argc, const_cast<const char**>(argv), initData);
}

/**
Expand All @@ -403,12 +397,9 @@ namespace Ice
* file and in the arguments, the arguments take precedence.
* Recognized options are removed from this vector upon return.
* @param configFile The name of an Ice configuration file.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
ICE_API CommunicatorPtr
initialize(int& argc, const char* argv[], const std::string& configFile, int version = ICE_INT_VERSION);
ICE_API CommunicatorPtr initialize(int& argc, const char* argv[], const std::string& configFile);

/**
* Initializes a new communicator.
Expand All @@ -421,14 +412,11 @@ namespace Ice
* file and in the arguments, the arguments take precedence.
* Recognized options are removed from this vector upon return.
* @param configFile The name of an Ice configuration file.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
inline CommunicatorPtr
initialize(int& argc, char* argv[], const std::string& configFile, int version = ICE_INT_VERSION)
inline CommunicatorPtr initialize(int& argc, char* argv[], const std::string& configFile)
{
return initialize(argc, const_cast<const char**>(argv), configFile, version);
return initialize(argc, const_cast<const char**>(argv), configFile);
}

#ifdef _WIN32
Expand All @@ -443,15 +431,12 @@ namespace Ice
* file and in the arguments, the arguments take precedence.
* Recognized options are removed from this vector upon return.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
ICE_API CommunicatorPtr initialize(
int& argc,
const wchar_t* argv[],
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION);
const InitializationData& initData = InitializationData());

/**
* Initializes a new communicator.
Expand All @@ -464,17 +449,14 @@ namespace Ice
* file and in the arguments, the arguments take precedence.
* Recognized options are removed from this vector upon return.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
inline CommunicatorPtr initialize(
int& argc,
wchar_t* argv[],
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION)
const InitializationData& initData = InitializationData())
{
return initialize(argc, const_cast<const wchar_t**>(argv), initData, version);
return initialize(argc, const_cast<const wchar_t**>(argv), initData);
}

/**
Expand All @@ -488,12 +470,9 @@ namespace Ice
* file and in the arguments, the arguments take precedence.
* Recognized options are removed from this vector upon return.
* @param configFile The name of an Ice configuration file.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
ICE_API CommunicatorPtr
initialize(int& argc, const wchar_t* argv[], const std::string& configFile, int version = ICE_INT_VERSION);
ICE_API CommunicatorPtr initialize(int& argc, const wchar_t* argv[], const std::string& configFile);

/**
* Initializes a new communicator.
Expand All @@ -506,14 +485,11 @@ namespace Ice
* file and in the arguments, the arguments take precedence.
* Recognized options are removed from this vector upon return.
* @param configFile The name of an Ice configuration file.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
inline CommunicatorPtr
initialize(int& argc, wchar_t* argv[], const std::string& configFile, int version = ICE_INT_VERSION)
inline CommunicatorPtr initialize(int& argc, wchar_t* argv[], const std::string& configFile)
{
return initialize(argc, const_cast<const wchar_t**>(argv), configFile, version);
return initialize(argc, const_cast<const wchar_t**>(argv), configFile);
}
#endif

Expand All @@ -526,14 +502,9 @@ namespace Ice
* file and in the arguments, the arguments take precedence.
* Recognized options are removed from this container upon return.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
ICE_API CommunicatorPtr initialize(
StringSeq& seq,
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION);
ICE_API CommunicatorPtr initialize(StringSeq& seq, const InitializationData& initData = InitializationData());

/**
* Initializes a new communicator.
Expand All @@ -544,30 +515,24 @@ namespace Ice
* file and in the arguments, the arguments take precedence.
* Recognized options are removed from this container upon return.
* @param configFile The name of an Ice configuration file.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
ICE_API CommunicatorPtr initialize(StringSeq& seq, const std::string& configFile, int version = ICE_INT_VERSION);
ICE_API CommunicatorPtr initialize(StringSeq& seq, const std::string& configFile);

/**
* Initializes a new communicator.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
ICE_API CommunicatorPtr
initialize(const InitializationData& initData = InitializationData(), int version = ICE_INT_VERSION);
initialize(const InitializationData& initData = InitializationData());

/**
* Initializes a new communicator.
* @param configFile The name of an Ice configuration file.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator.
*/
ICE_API CommunicatorPtr initialize(const std::string& configFile, int version = ICE_INT_VERSION);
ICE_API CommunicatorPtr initialize(const std::string& configFile);

/**
* Obtains the per-process logger. This logger is used by all communicators that do not have their
Expand Down
31 changes: 7 additions & 24 deletions cpp/include/Ice/Service.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,12 @@ namespace Ice
* @param argc Specifies the number of arguments in argv.
* @param argv The command-line arguments.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The application's exit status: EXIT_FAILURE or EXIT_SUCCESS.
*/
int main(
int argc,
const char* const argv[],
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION);
const InitializationData& initData = InitializationData());

#ifdef _WIN32
/**
Expand All @@ -92,15 +89,12 @@ namespace Ice
* @param argc Specifies the number of arguments in argv.
* @param argv The command-line arguments.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The application's exit status: EXIT_FAILURE or EXIT_SUCCESS.
*/
int main(
int argc,
const wchar_t* const argv[],
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION);
const InitializationData& initData = InitializationData());
#endif

/**
Expand All @@ -123,14 +117,11 @@ namespace Ice
*
* @param args The command-line arguments.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The application's exit status: EXIT_FAILURE or EXIT_SUCCESS.
*/
int main(
const StringSeq& args,
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION);
const InitializationData& initData = InitializationData());

/**
* Obtains the communicator created by the service.
Expand Down Expand Up @@ -177,15 +168,12 @@ namespace Ice
* @param argc Specifies the number of arguments in argv.
* @param argv The command-line arguments.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The application's exit status: EXIT_FAILURE or EXIT_SUCCESS.
*/
int
run(int argc,
const wchar_t* const argv[],
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION);
const InitializationData& initData = InitializationData());
#endif

/**
Expand All @@ -199,15 +187,12 @@ namespace Ice
* @param argc Specifies the number of arguments in argv.
* @param argv The command-line arguments.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The application's exit status: EXIT_FAILURE or EXIT_SUCCESS.
*/
int
run(int argc,
const char* const argv[],
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION);
const InitializationData& initData = InitializationData());

#ifdef _WIN32

Expand Down Expand Up @@ -275,12 +260,10 @@ namespace Ice
* @param argc Specifies the number of arguments in argv.
* @param argv The command-line arguments.
* @param initData Configuration data for the new Communicator.
* @param version Indicates the Ice version with which the application is compatible. If not
* specified, the version of the Ice installation is used.
* @return The new communicator instance.
*/
virtual Ice::CommunicatorPtr
initializeCommunicator(int& argc, char* argv[], const InitializationData& initData, int version);
initializeCommunicator(int& argc, char* argv[], const InitializationData& initData);

/**
* Logs a system error, which includes a description of the
Expand Down Expand Up @@ -376,7 +359,7 @@ namespace Ice

#else

int runDaemon(int, char*[], const InitializationData&, int);
int runDaemon(int, char*[], const InitializationData&);

bool _changeDirectory;
bool _closeFiles;
Expand Down
10 changes: 3 additions & 7 deletions cpp/src/Glacier2/Glacier2Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace
protected:
bool start(int, char*[], int&) override;
bool stop() override;
CommunicatorPtr initializeCommunicator(int&, char*[], const InitializationData&, int) override;
CommunicatorPtr initializeCommunicator(int&, char*[], const InitializationData&) override;

private:
void usage(const std::string&);
Expand Down Expand Up @@ -410,11 +410,7 @@ RouterService::stop()
}

CommunicatorPtr
RouterService::initializeCommunicator(
int& argc,
char* argv[],
const InitializationData& initializationData,
int version)
RouterService::initializeCommunicator(int& argc, char* argv[], const InitializationData& initializationData)
{
InitializationData initData = initializationData;
initData.properties = createProperties(argc, argv, initializationData.properties);
Expand Down Expand Up @@ -456,7 +452,7 @@ RouterService::initializeCommunicator(
// for incoming connections from clients must be disabled in
// the clients.

return Service::initializeCommunicator(argc, argv, initData, version);
return Service::initializeCommunicator(argc, argv, initData);
}

void
Expand Down
Loading
Loading