Data Structures | Namespaces | Typedefs | Functions

IntrusivePtr.h File Reference

This is a simple shared pointer class for restricted use. More...

#include <sys/types.h>
#include <assert.h>
#include <functional>
Include dependency graph for IntrusivePtr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  ts::IntrusivePtrBase
 This class exists solely to be declared a friend of IntrusivePtrCounter. More...
class  ts::IntrusivePtrCounter
 Reference counter mixin. More...
class  ts::IntrusivePtr< T >
 Shared pointer. More...
class  ts::IntrusivePtrPolicy< T >
 Default policy class for intrusive pointers. More...
class  ts::IntrusivePtrPolicy< T >::Order
 Strict weak order for STL containers. More...
struct  ts::IntrusivePtrDefaultPolicyTag

Namespaces

namespace  ts
 

Apache Traffic Server commons.


Typedefs

typedef IntrusivePtrPolicy
< IntrusivePtrDefaultPolicyTag > 
ts::IntrusivePtrDefaultPolicy

Functions

template<typename T , typename X >
IntrusivePtr< T > ts::dynamic_ptr_cast (IntrusivePtr< X > const &src)
 Pointer dynamic cast.
template<typename T , typename X >
IntrusivePtr< T > ts::ptr_cast (IntrusivePtr< X > const &src)
 Pointer cast.
template<typename T >
bool ts::operator== (IntrusivePtr< T > const &lhs, IntrusivePtr< T > const &rhs)
template<typename T >
bool ts::operator!= (IntrusivePtr< T > const &lhs, IntrusivePtr< T > const &rhs)
template<typename T >
bool ts::operator< (IntrusivePtr< T > const &lhs, IntrusivePtr< T > const &rhs)
template<typename T >
bool ts::operator== (IntrusivePtr< T > const &lhs, int rhs)
template<typename T >
bool ts::operator== (int lhs, IntrusivePtr< T > const &rhs)
template<typename T >
bool ts::operator!= (int lhs, IntrusivePtr< T > const &rhs)
template<typename T >
bool ts::operator!= (IntrusivePtr< T > const &lhs, int rhs)

Detailed Description

This is a simple shared pointer class for restricted use.

It is not a completely general class. The most significant missing feature is the lack of thread safety. For its intended use, this is acceptable and provides a performance improvement. However, it does restrict how the class may be used.

This style of shared pointer also requires explicit support from the target class, which must provide an internal reference counter.

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file IntrusivePtr.h.