blob: f575056d351c177a4e32bfc443f239a5b3c52af7 [file] [log] [blame]
Alexander Afanasyeve00ffbe2012-03-05 00:01:36 -08001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2012 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
19 * 卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
20 * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
21 */
22
23#include "sync-full-leaf.h"
24#include <boost/ref.hpp>
25
26using namespace boost;
27
28namespace Sync {
29
30FullLeaf::FullLeaf (NameInfoConstPtr info, const SeqNo &seq)
31 : Leaf (info, seq)
32{
33 updateDigest ();
34}
35
36void
37FullLeaf::updateDigest ()
38{
39 m_digest.reset ();
40 m_digest << getInfo ().getDigest () << getSeq ().getDigest ();
41}
42
43// from Leaf
44void
45FullLeaf::setSeq (const SeqNo &seq)
46{
47 Leaf::setSeq (seq);
48 updateDigest ();
49}
50
51} // Sync