C++ and Java Changes
API Changes
The referenced_by()
methods were changed. The code
using them need to be modified!
Now these methods allow to return objects referencing given object via
composite (old behavior) and weak (new) relationships.
Unfortunately there are some changes in API:
- the class_name argument was removed from config layer,
since
it was never used and can be efficiently replaced by config cast, if
really needed
- the check_composite_only argument was added to switch
between
composite relationships (efficient) and weak ones (use carefully, it is
non-scalable!)
The relationship name by default is set to "*" to allow return objects
referencing given one via any relationship. Set it to any explicit
name, if necessary. Leave check_composite_only parameter with default
value to keep old
behavior.
The exact methods declarations and descriptions of modified parameters
are:
1. Template method of Configuration
class:
* \param
obj
object
* \param
objects
returned value
* \param
relationship_name name of the relationship, via
which the object is referenced
* \param
check_composite_only only returned composite parent
objects
template<class T, class V> void referenced_by(
const T& obj,
std::vector<const V*>& objects,
const std::string& relationship_name = "*",
bool check_composite_only = true,
bool init = false,
unsigned long rlevel = 0,
const std::vector<std::string> * rclasses = 0) throw
(daq::config::Generic);
2. The method of ConfigObject
class:
* \param
value
returned objects
* \param
relationship_name name of relationship (if "*",
then return objects referencing via ANY relationship)
* \param
check_composite_only only returned composite parent
objects
void referenced_by(
std::vector<ConfigObject>& value,
const std::string& relationship_name = "*",
bool check_composite_only = true,
unsigned long rlevel = 0,
const std::vector<std::string> * rclasses = 0 ) const
throw
(daq::config::Generic);
New C++ API to Get Schema Description
The new API to get database schema description is defined by the config/Schema.h
file. The complete list of classes defined by the schema can be
obtained using Configuration::superclasses() method. Once name of class
is known, it's properties can be queried using new Configuration method:
const daq::config::class_t& get_class_info(const std::string& class_name, bool direct_only = false) throw (daq::config::Generic, daq::config::NotFound)
The old get_class_info(const std::string& class_name, MetaDataType
type, bool ...)
method is supported in 1.8.4 and will be removed in longer term.
Bug fixes
- Fix wrong C++ code deleting an object pointed by set's iterator
(may
be a reason of rare crashes)
- Fix unload() C++ method bug, if it was called twice (uncleared
map
contains destroyed objects, which are destroyed second time; came from
LArg)
- Correct C++ DEBUG output in several cases (config template cast,
search of implementation objects in cache)
- Proper C++ reload of database in case of objects removing (fix
setup
crash)
Other Improvements:
- The C++ Configuration::superclasses() returns map of all classes
including those which have no base ones; for the moment this is the
only way to get list of all classes from config layer and this is
required for Partition Maker's dynamic Python bindings. See also Savannah request https://savannah.cern.ch/bugs/?30737
- Allow re-create removed C++ DAL objects (basically now user is
allowed to
reload database after any modifications [except of changes with include
files]).
- Put JNI implementation for Java oksconfig plug-in set methods
(before it was not possible to use Java config layer with oks plug-in
to modify database).
- Add method ConfigObject::contained_in() returning name of file
the object belongs to.