~zorba-coders/zorba/bugs-912586-912593-912722

« back to all changes in this revision

Viewing changes to src/compiler/semantic_annotations/annotation_holder.cpp

  • Committer: Cezar Andrei
  • Date: 2012-03-28 15:42:12 UTC
  • mfrom: (10606.1.129 zorba)
  • Revision ID: cezar.lp@cezarandrei.com-20120328154212-jh2heq49xcqjppce
Merge from trunck and resolve ChangeLog conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2006-2008 The FLWOR Foundation.
3
 
 * 
4
 
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 
 * you may not use this file except in compliance with the License.
6
 
 * You may obtain a copy of the License at
7
 
 * 
8
 
 * http://www.apache.org/licenses/LICENSE-2.0
9
 
 * 
10
 
 * Unless required by applicable law or agreed to in writing, software
11
 
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 
 * See the License for the specific language governing permissions and
14
 
 * limitations under the License.
15
 
 */
16
 
#include "stdafx.h"
17
 
 
18
 
#include "compiler/semantic_annotations/annotation_holder.h"
19
 
 
20
 
namespace zorba {
21
 
 
22
 
 
23
 
void AnnotationHolder::serialize(::zorba::serialization::Archiver& ar)
24
 
{
25
 
  //ar & m_annotations;
26
 
}
27
 
 
28
 
 
29
 
void AnnotationHolder::put_annotation(
30
 
    Annotations::Key key,
31
 
    AnnotationValue_t value)
32
 
{
33
 
  m_annotations[key] = value;
34
 
}
35
 
 
36
 
 
37
 
const AnnotationValue_t AnnotationHolder::get_annotation(
38
 
    Annotations::Key key) const
39
 
{
40
 
  annotations_t::const_iterator i = m_annotations.find(key);
41
 
  if (i == m_annotations.end()) {
42
 
    return AnnotationValue_t();
43
 
  }
44
 
  return i->second;
45
 
}
46
 
 
47
 
 
48
 
void AnnotationHolder::remove_annotation(Annotations::Key key)
49
 
{
50
 
  annotations_t::iterator i = m_annotations.find(key);
51
 
  if (i != m_annotations.end()) {
52
 
    m_annotations.erase(i);
53
 
  }
54
 
}
55
 
 
56
 
}
57
 
/* vim:set et sw=2 ts=2: */