xpcom/glue/nsDataHashtable.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/glue/nsDataHashtable.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsDataHashtable_h__
    1.10 +#define nsDataHashtable_h__
    1.11 +
    1.12 +#include "nsHashKeys.h"
    1.13 +#include "nsBaseHashtable.h"
    1.14 +
    1.15 +/**
    1.16 + * templated hashtable class maps keys to simple datatypes.
    1.17 + * See nsBaseHashtable for complete declaration
    1.18 + * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h
    1.19 + *   for a complete specification.
    1.20 + * @param DataType the simple datatype being wrapped
    1.21 + * @see nsInterfaceHashtable, nsClassHashtable
    1.22 + */
    1.23 +template<class KeyClass,class DataType>
    1.24 +class nsDataHashtable :
    1.25 +  public nsBaseHashtable<KeyClass,DataType,DataType>
    1.26 +{
    1.27 +public:
    1.28 +  nsDataHashtable()
    1.29 +  {
    1.30 +  }
    1.31 +  explicit nsDataHashtable(uint32_t aInitSize)
    1.32 +    : nsBaseHashtable<KeyClass,DataType,DataType>(aInitSize)
    1.33 +  {
    1.34 +  }
    1.35 +};
    1.36 +
    1.37 +#endif // nsDataHashtable_h__

mercurial