• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ key_type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中key_type的典型用法代码示例。如果您正苦于以下问题:C++ key_type类的具体用法?C++ key_type怎么用?C++ key_type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了key_type类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: m_lock

FileBase::FileBase(int data_fd, int meta_fd, const key_type& key_, const id_type& id_, bool check)
    : m_lock()
    , m_refcount(1)
    , m_header()
    , m_id(id_)
    , m_data_fd(data_fd)
    , m_meta_fd(meta_fd)
    , m_dirty(false)
    , m_check(check)
    , m_stream()
    , m_removed(false)
{
    auto data_stream = std::make_shared<POSIXFileStream>(data_fd);
    auto meta_stream = std::make_shared<POSIXFileStream>(meta_fd);

    key_type data_key, meta_key;
    byte generated_keys[KEY_LENGTH * 3];
    hkdf(key_.data(),
         key_.size(),
         nullptr,
         0,
         id_.data(),
         id_.size(),
         generated_keys,
         sizeof(generated_keys));
    memcpy(data_key.data(), generated_keys, KEY_LENGTH);
    memcpy(meta_key.data(), generated_keys + KEY_LENGTH, KEY_LENGTH);
    memcpy(m_key.data(), generated_keys + 2 * KEY_LENGTH, KEY_LENGTH);
    auto crypt = make_cryptstream_aes_gcm(
        std::move(data_stream), std::move(meta_stream), data_key, meta_key, id_, check);

    m_stream = crypt.first;
    m_header = crypt.second;
    read_header();
}
开发者ID:NextGenIntelligence,项目名称:securefs,代码行数:35,代码来源:files.cpp


示例2: insert

    iterator insert( const key_type& key)
    {
        if( empty())
        {
            keys().push_back( key);
            return begin();
        }

        if( key.time() < front().time())
        {
            keys().insert( begin(), key);
            return begin();
        }

        if( key.time() > back().time())
        {
            keys().push_back( key);
            return end() - 1;
        }

        iterator it( lower_bound( key.time()));

        if( abs( it->time() - key.time()) <= keyframe_t::time_tolerance())
        {
		    *it = key;
            return it;
        }
        else
            return keys().insert( it, key);
    }
开发者ID:JohanAberg,项目名称:Ramen,代码行数:30,代码来源:keyframe_vector.hpp


示例3: key

 const key_type& key() {
   if(!reversed_key_) {
     key_.set_bits(0, ary_->lsize(), ary_->inverse_matrix().times(key_));
     reversed_key_ = true;
   }
   return key_;
 }
开发者ID:AndyGreenwell,项目名称:Jellyfish,代码行数:7,代码来源:large_hash_iterator.hpp


示例4:

slirc::channeluser_list::size_type slirc::channeluser_list::erase(const key_type &key) {
	slirc::channeluser_list::size_type ret = baseclass::erase(key);
	if (ret && detacher) {
		key->detach();
	}
	return ret;
}
开发者ID:SlashLife,项目名称:libslirc-old,代码行数:7,代码来源:channeluser.cpp


示例5: operator

 void operator()(const key_type &key, std::array<M128I<U>, Rp1> &rk) const
 {
     M128I<std::uint64_t> weyl;
     weyl.set(
         ARSWeylConstantTrait<1>::value, ARSWeylConstantTrait<0>::value);
     std::get<0>(rk).load(key.data());
     generate<1>(rk, weyl, std::integral_constant<bool, 1 < Rp1>());
 }
开发者ID:zhouyan,项目名称:vSMC,代码行数:8,代码来源:ars.hpp


示例6: InvalidArgumentException

FileTable::FileTable(int version,
                     std::shared_ptr<FileSystemService> root,
                     const key_type& master_key,
                     uint32_t flags,
                     unsigned block_size,
                     unsigned iv_size)
    : m_flags(flags), m_block_size(block_size), m_iv_size(iv_size), m_root(root)
{
    memcpy(m_master_key.data(), master_key.data(), master_key.size());
    switch (version)
    {
    case 1:
        m_fio.reset(new FileTableIOVersion1(root, is_readonly()));
        break;
    case 2:
        m_fio.reset(new FileTableIOVersion2(root, is_readonly()));
        break;
    default:
        throw InvalidArgumentException("Unknown version");
    }
}
开发者ID:geneticgrabbag,项目名称:securefs,代码行数:21,代码来源:file_table.cpp


示例7:

MappingIterator::MappingIterator(const ObjectHandle& containerHandle, const container_type& container,
                                 const key_type& key, const Converters& typeConverters)
    : containerHandle_(containerHandle), container_(container), keys_(container_.keys(PyScript::ScriptErrorPrint())),
      index_(0), key_(key), typeConverters_(typeConverters)
{
	if (!key_.exists())
	{
		index_ = container_.size();
	}
	else
	{
		bool found = false;
		// If the key is not found, then index_ == end
		for (; index_ < keys_.size(); ++index_)
		{
			auto scriptKey = keys_.getItem(index_);
			if (key.compareTo(scriptKey, PyScript::ScriptErrorPrint()) == 0)
			{
				found = true;
				break;
			}
		}

		// HACK NGT-1603 Try to cast key to an index
		// Work-around for how ReflectedPropertyItem::getChild will try to
		// access items with the a string "[index]"
		if (!found)
		{
			Variant result;
			ObjectHandle parentHandle;
			const char* childPath = "";
			const bool success = typeConverters_.toVariant(key_, result, parentHandle, childPath);
			PyScript::ScriptList::size_type fakeIndex = container_.size();
			const bool isIndex = result.tryCast(fakeIndex);

			if (isIndex && (fakeIndex >= 0) && (fakeIndex < container_.size()))
			{
				index_ = fakeIndex;
				key_ = keys_.getItem(index_);
			}
		}
	}
}
开发者ID:wgsyd,项目名称:wgtf,代码行数:43,代码来源:mapping_iterator.cpp


示例8: operator

    typename Matrix::size_type operator() (key_type const& key) const
    {
	return key.col();
    }
开发者ID:AlexanderToifl,项目名称:viennamesh-dev,代码行数:4,代码来源:property_map_impl.hpp


示例9: return

 reference operator[](key_type key) const { return (*internal_vector)[key->id()]; }
开发者ID:NobodyZhou,项目名称:cgal,代码行数:1,代码来源:Polyhedron_demo_mesh_segmentation_plugin.cpp


示例10:

 math::natural traits<phys::constraint::unilateral::key>::dimension(key_type k) { return k->dim(); }
开发者ID:Jorjor70,项目名称:meuh,代码行数:1,代码来源:unilateral.cpp


示例11: get

 inline friend reference get(const Constrained_edge_map& em, key_type e)
 {
   bool b = em.sm_.property(em.constraint,em.sm_.edge_handle(e.idx())); 
   return b;
 }
开发者ID:CGAL,项目名称:releases,代码行数:5,代码来源:edge_collapse_OpenMesh.cpp


示例12: find

 /*!
  * The method finds the attribute value by name.
  *
  * \param key Attribute name.
  * \return Iterator to the found element or \c end() if the attribute with such name is not found.
  */
 const_iterator find(key_type const& key) const
 {
     return find_impl(key.data(), key.size());
 }
开发者ID:saga-project,项目名称:saga-cpp-legacy-projects,代码行数:10,代码来源:attribute_values_view.hpp


示例13: operator

 bool operator()(const key_type& x, const key_type& y) const { return x.here() < y.here(); }
开发者ID:ceplus,项目名称:unfact,代码行数:1,代码来源:tick_tracer.hpp


示例14: atoi

int atoi_fast::atoi(const key_type& k, int offset) const
{
   char* string = k.get();
   int l = k.size();
   return atoi((const char*)string, l, offset, 0);
}
开发者ID:,项目名称:,代码行数:6,代码来源:


示例15:

 value_type operator[] (const key_type& k) const { return k.get_id(); }
开发者ID:Auguraculums,项目名称:graphdb-testing,代码行数:1,代码来源:xmt_hash_table_adapter.hpp


示例16: init_decrypt

			void init_decrypt(AES_KEY &ctx, const key_type &key, const iv_type &iv)
			{
				AES_set_decrypt_key(&key[0], key.size() * 8, &ctx);
			}
开发者ID:JaewookYim,项目名称:salm,代码行数:4,代码来源:aes.hpp


示例17: put

 // The put function is required by the property map concept.
 friend void put(const Extended_face_property_map& map,
                 key_type key, value_type val)
 { key->set_data(val); }
开发者ID:eLRuLL,项目名称:CGAL,代码行数:4,代码来源:bgl_dual_adapter.cpp


示例18: operator

 result_type operator() (key_type const& left, key_type const& right) const
 {
     return left.id() < right.id();
 }
开发者ID:yhager,项目名称:boost-log,代码行数:4,代码来源:test_sink.hpp


示例19: TEST_CASE

#include <string.h>
#include <errno.h>
#include <vector>
#include <algorithm>
#include <set>

#include <fcntl.h>
#include <unistd.h>

TEST_CASE("File table")
{
    using namespace securefs;
    char dir_template[] = "/tmp/securefs_file_table.XXXXXXX";
    mkdtemp(dir_template);

    key_type master_key;
    id_type null_id, file_id;
    memset(master_key.data(), 0xFF, master_key.size());
    memset(null_id.data(), 0, null_id.size());
    memset(file_id.data(), 0xEE, file_id.size());
    const char* xattr_name = "com.apple.FinderInfo...";
    const securefs::PODArray<char, 32> xattr_value(0x11);

    {
        int tmp_fd = ::open(dir_template, O_RDONLY);
        REQUIRE(tmp_fd >= 0);
        FileTable table(tmp_fd, master_key, 0);
        auto dir = dynamic_cast<Directory*>(table.create_as(null_id, FileBase::DIRECTORY));
        dir->add_entry(".", null_id, FileBase::DIRECTORY);
        dir->add_entry("..", null_id, FileBase::DIRECTORY);
        dir->add_entry("hello", file_id, FileBase::REGULAR_FILE);
开发者ID:NextGenIntelligence,项目名称:securefs,代码行数:31,代码来源:test_files.cpp


示例20: get

 // The get function is required by the property map concept.
 friend reference get(const Extended_face_property_map& /* map */,
                      key_type key)
 {
     return key->data();
 }
开发者ID:logtcn,项目名称:cgal,代码行数:6,代码来源:bgl_dual_adapter.cpp



注:本文中的key_type类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ klassOop类代码示例发布时间:2022-05-31
下一篇:
C++ jsval类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap