Skip to content

Commit

Permalink
Merge branch 'main' into 2855-limit-property-scope
Browse files Browse the repository at this point in the history
  • Loading branch information
externl authored Oct 28, 2024
2 parents 79ce92c + d2a0336 commit 5065e0b
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 202 deletions.
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
84 changes: 20 additions & 64 deletions cpp/include/Ice/Initialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,10 @@ 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);
ICE_API CommunicatorPtr
initialize(int& argc, const char* argv[], const InitializationData& initData = InitializationData());

/**
* Initializes a new communicator.
Expand All @@ -379,17 +374,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.
*/
inline CommunicatorPtr initialize(
int& argc,
char* argv[],
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION)
inline CommunicatorPtr
initialize(int& argc, char* argv[], 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 +393,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 +408,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 +427,10 @@ 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);
ICE_API CommunicatorPtr
initialize(int& argc, const wchar_t* argv[], const InitializationData& initData = InitializationData());

/**
* Initializes a new communicator.
Expand All @@ -464,17 +443,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.
*/
inline CommunicatorPtr initialize(
int& argc,
wchar_t* argv[],
const InitializationData& initData = InitializationData(),
int version = ICE_INT_VERSION)
inline CommunicatorPtr
initialize(int& argc, wchar_t* argv[], 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 +462,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 +477,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 +494,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 +507,23 @@ 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);
ICE_API CommunicatorPtr 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
45 changes: 7 additions & 38 deletions cpp/include/Ice/Service.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,9 @@ 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);
int main(int argc, const char* const argv[], const InitializationData& initData = InitializationData());

#ifdef _WIN32
/**
Expand All @@ -92,15 +86,9 @@ 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);
int main(int argc, const wchar_t* const argv[], const InitializationData& initData = InitializationData());
#endif

/**
Expand All @@ -123,14 +111,9 @@ 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);
int main(const StringSeq& args, const InitializationData& initData = InitializationData());

/**
* Obtains the communicator created by the service.
Expand Down Expand Up @@ -177,15 +160,9 @@ 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);
int run(int argc, const wchar_t* const argv[], const InitializationData& initData = InitializationData());
#endif

/**
Expand All @@ -199,15 +176,9 @@ 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);
int run(int argc, const char* const argv[], const InitializationData& initData = InitializationData());

#ifdef _WIN32

Expand Down Expand Up @@ -275,12 +246,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 +345,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

0 comments on commit 5065e0b

Please sign in to comment.