2 * Copyright (c) 2017 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #include "vom/object_base.hpp"
19 object_ref::object_ref(std::shared_ptr<object_base> obj)
21 , m_state(OBJECT_STATE_NONE)
26 object_ref::operator<(const object_ref& other) const
28 return (m_obj.get() < other.m_obj.get());
31 std::shared_ptr<object_base>
32 object_ref::obj() const
38 object_ref::mark() const
40 m_state = OBJECT_STATE_STALE;
44 object_ref::clear() const
46 m_state = OBJECT_STATE_NONE;
50 object_ref::stale() const
52 return (m_state == OBJECT_STATE_STALE);
56 operator<<(std::ostream& os, const object_base& o)
65 * fd.io coding-style-patch-verification: ON
68 * eval: (c-set-style "mozilla")