1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2014 Adam Crume <adamcrume@gmail.com>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef _INCLUDED_RBD_REPLAY_IMAGENAMEMAP_HPP
16 #define _INCLUDED_RBD_REPLAY_IMAGENAMEMAP_HPP
20 #include "rbd_loc.hpp"
22 namespace rbd_replay {
29 typedef std::pair<rbd_loc, rbd_loc> Mapping;
33 If parsing fails, the contents of \c mapping are undefined.
34 @param[in] mapping_string string representation of the mapping
35 @param[out] mapping stores the parsed mapping
36 @retval true parsing was successful
38 bool parse_mapping(std::string mapping_string, Mapping *mapping) const;
40 void add_mapping(const Mapping& mapping);
44 If no mapping matches the name, it is returned unmodified.
46 rbd_loc map(const rbd_loc& name) const;
49 std::map<rbd_loc, rbd_loc> m_map;