New Methods
Cast Methods
Implement new template cast method in DalObject C++ class:
template<class TARGET> const TARGET * cast() const noexcept;
There is no need to pass configuration pointer. Only template
parameter is needed, e.g.:
daq::core::BaseApplication * base_app = ... // some pointer on base application object
if(daq::core::Application * app = base_app->cast<daq::core::Application>())
{
std::cout << app << " is an application\n";
}
This method should be used instead of obsolete method of Configuration
class:
template<class TARGET, class SOURCE> const TARGET *cast(const SOURCE *s) noexcept;
since above method requires extra parameter (i.e. configuration
object) and usually complicated a code.
Similarly, in Java genconfig generates the cast methods containing
single parameter referencing DAL object. Old methods requiring two
parameters should not be used anymore and marked as deprecated, e.g.
see dal/Application_Helper.java:
@Deprecated
static public Application cast(config.Configuration db, config.DalObject obj) {
return cast(obj);
}
/**
* Method to casts existing object to object of Application class.
* @param obj config object
*/
static public Application cast(config.DalObject obj) {
...
}
Add is_writable() Method
To implement feature request 90969 add C++
method:
bool Configuration::is_writable(const std::string& db_name) const;
that checks a possibility to update database file by current user
(supports files stored on the OKS server repository checking Access
Manager permissions).
Add move() Method
To implement feature request 97465 add C++
method:
void ConfigObject::move(const std::string& at);
that moves config object into a different file.
General
Remove any explicit throw specifications in methods of C++
classes, since they are obsolete in C++ 11 standard. The explicit noexcept
specification is used, if the method may not throw an exception.
Otherwise exception specification is provided in DoxyGen
documentation.