proxygen
SyncVec< T > Struct Template Reference

Public Member Functions

 SyncVec ()
 
 ~SyncVec ()
 
void push_back (const T &t)
 
void lock ()
 
void unlock ()
 
Tbegin () const
 
Tend () const
 

Public Attributes

PackedSyncPtr< Tbase
 

Detailed Description

template<typename T>
struct SyncVec< T >

Definition at line 73 of file PackedSyncPtrTest.cpp.

Constructor & Destructor Documentation

template<typename T >
SyncVec< T >::SyncVec ( )
inline

Definition at line 75 of file PackedSyncPtrTest.cpp.

References folly::PackedSyncPtr< T >::init().

75  {
76  base.init();
77  }
PackedSyncPtr< T > base
template<typename T >
SyncVec< T >::~SyncVec ( )
inline

Definition at line 78 of file PackedSyncPtrTest.cpp.

References bm::free(), and folly::PackedSyncPtr< T >::get().

78  {
79  free(base.get());
80  }
PackedSyncPtr< T > base
void free()

Member Function Documentation

template<typename T >
T* SyncVec< T >::begin ( ) const
inline

Definition at line 93 of file PackedSyncPtrTest.cpp.

References folly::PackedSyncPtr< T >::get().

93  {
94  return base.get();
95  }
PackedSyncPtr< T > base
template<typename T >
T* SyncVec< T >::end ( ) const
inline

Definition at line 96 of file PackedSyncPtrTest.cpp.

References folly::PackedSyncPtr< T >::extra(), and folly::PackedSyncPtr< T >::get().

96  {
97  return base.get() + base.extra();
98  }
PackedSyncPtr< T > base
template<typename T >
void SyncVec< T >::lock ( )
inline

Definition at line 86 of file PackedSyncPtrTest.cpp.

References folly::PackedSyncPtr< T >::lock().

86  {
87  base.lock();
88  }
PackedSyncPtr< T > base
template<typename T >
void SyncVec< T >::push_back ( const T t)
inline

Definition at line 81 of file PackedSyncPtrTest.cpp.

References folly::PackedSyncPtr< T >::extra(), folly::PackedSyncPtr< T >::get(), folly::PackedSyncPtr< T >::set(), folly::PackedSyncPtr< T >::setExtra(), folly::pushmi::detail::t, and T.

81  {
82  base.set((T*)realloc(base.get(), (base.extra() + 1) * sizeof(T)));
83  base[base.extra()] = t;
84  base.setExtra(base.extra() + 1);
85  }
#define T(v)
Definition: http_parser.c:233
PackedSyncPtr< T > base
template<typename T >
void SyncVec< T >::unlock ( )
inline

Definition at line 89 of file PackedSyncPtrTest.cpp.

References folly::PackedSyncPtr< T >::unlock().

89  {
90  base.unlock();
91  }
PackedSyncPtr< T > base

Member Data Documentation

template<typename T >
PackedSyncPtr<T> SyncVec< T >::base

Definition at line 74 of file PackedSyncPtrTest.cpp.


The documentation for this struct was generated from the following file: