#include <ctime>
#include <string>
#include <vector>
-#include <list>
#include <map>
#include "snapper/Exception.h"
{
using std::string;
using std::vector;
- using std::list;
using std::map;
return marshaller;
}
-
- template <typename Type>
- Unmarshaller& operator>>(Unmarshaller& unmarshaller, list<Type>& data)
- {
- if (unmarshaller.get_type() != DBUS_TYPE_ARRAY)
- throw MarshallingException();
-
- unmarshaller.open_recurse();
-
- while (unmarshaller.get_type() != DBUS_TYPE_INVALID)
- {
- if (unmarshaller.get_signature() != TypeInfo<Type>::signature)
- throw MarshallingException();
-
- Type tmp;
- unmarshaller >> tmp;
- data.push_back(tmp);
- }
-
- unmarshaller.close_recurse();
-
- return unmarshaller;
- }
-
-
- template <typename Type>
- Marshaller& operator<<(Marshaller& marshaller, const list<Type>& data)
- {
- marshaller.open_array(TypeInfo<Type>::signature);
-
- for (typename list<Type>::const_iterator it = data.begin(); it != data.end(); ++it)
- {
- marshaller << *it;
- }
-
- marshaller.close_array();
-
- return marshaller;
- }
-
}
" </interface>\n"
"</node>\n";
+ y2deb("Introspect");
+
DBus::MessageMethodReturn reply(msg);
DBus::Marshaller marshaller(reply);
void
Client::signal_snapshots_deleted(DBus::Connection& conn, const string& config_name,
- const list<dbus_uint32_t>& nums)
+ const vector<dbus_uint32_t>& nums)
{
DBus::MessageSignal msg(PATH, INTERFACE, "SnapshotsDeleted");
Client::delete_snapshots(DBus::Connection& conn, DBus::Message& msg)
{
string config_name;
- list<dbus_uint32_t> nums;
+ vector<dbus_uint32_t> nums;
DBus::Unmarshaller unmarshaller(msg);
unmarshaller >> config_name >> nums;
- y2deb("DeleteSnapshots config_name:" << config_name << " nums:" << nums);
+ y2mil("DeleteSnapshots config_name:" << config_name << " nums:" << nums);
boost::unique_lock<boost::shared_mutex> lock(big_mutex);
Snapper* snapper = it1->getSnapper();
Snapshots& snapshots = snapper->getSnapshots();
- for (list<unsigned int>::const_iterator it2 = nums.begin(); it2 != nums.end(); ++it2)
+ for (vector<unsigned int>::const_iterator it2 = nums.begin(); it2 != nums.end(); ++it2)
{
check_snapshot_in_use(*it1, *it2);
void signal_snapshot_modified(DBus::Connection& conn, const string& config_name,
unsigned int num);
void signal_snapshots_deleted(DBus::Connection& conn, const string& config_name,
- const list<dbus_uint32_t>& nums);
+ const vector<dbus_uint32_t>& nums);
void list_configs(DBus::Connection& conn, DBus::Message& msg);
void get_config(DBus::Connection& conn, DBus::Message& msg);