本文整理汇总了C++中ihash类的典型用法代码示例。如果您正苦于以下问题:C++ ihash类的具体用法?C++ ihash怎么用?C++ ihash使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ihash类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: waitpid
void
chldcb_check ()
{
for (;;) {
int status;
pid_t pid = waitpid (-1, &status, WNOHANG);
if (pid == 0 || pid == -1)
break;
if (child *c = chldcbs[pid]) {
chldcbs.remove (c);
#ifdef WRAP_DEBUG
if (callback_trace & CBTR_CHLD)
warn ("CALLBACK_TRACE: %schild pid %d (status %d) %s <- %s\n",
timestring (), pid, status, c->cb->dest, c->cb->line);
#endif /* WRAP_DEBUG */
STOP_ACHECK_TIMER ();
sfs_leave_sel_loop ();
(*c->cb) (status);
START_ACHECK_TIMER ();
delete c;
} else if (sfs_core::g_zombie_collect) {
zombie_t *z = zombies[pid];
if (z) {
z->_status = status;
} else {
zombies.insert (New zombie_t (pid, status));
}
}
}
}
开发者ID:gildafnai82,项目名称:craq,代码行数:30,代码来源:core.C
示例2: while
void
update ()
{
if (simulated_input) return;
f_node *n = nodes.first ();
while (n) {
update (n);
n = nodes.next (n);
}
}
开发者ID:Amit-DU,项目名称:dht,代码行数:10,代码来源:vis_update.C
示例3: dir
afsdirentry::afsdirentry (afsdir *dir, const str &name, afsnode *node)
: dir (dir), name (name), node (mkref (node)), cookie (gencookie ())
{
node->addlink ();
cookietab.insert (this);
dir->entries.insert (this);
}
开发者ID:gildafnai82,项目名称:craq,代码行数:7,代码来源:afsdir.C
示例4: sprintf
f_node *
add_node (const chord_node &n)
{
f_node *nu = nodes[n.x];
if (!nu) {
warn << "added " << n << "\n";
nu = New f_node (n);
nodes.insert (nu);
char nodess[1024];
sprintf (nodess, "%zd nodes", nodes.size ());
gtk_label_set_text (GTK_LABEL (total_nodes), nodess);
}
get_queue.push_back (n.x);
return nu;
}
开发者ID:Amit-DU,项目名称:dht,代码行数:16,代码来源:vis_update.C
示例5: assert
void
closesim::fhfree (fhtimer *fht)
{
assert (fht->serv == this);
fq->timeq.remove (fht);
fhtab.remove (fht);
fq->minopen++;
delete fht;
}
开发者ID:gildafnai82,项目名称:craq,代码行数:9,代码来源:closesim.C
示例6: if
void
chldcb (pid_t pid, cbi::ptr cb)
{
if (child *c = chldcbs[pid]) {
chldcbs.remove (c);
delete c;
}
zombie_t *z;
if ((z = zombies[pid])) {
int s = z->_status;
zombies.remove (z);
delete z;
if (cb)
(*cb) (s);
} else if (cb) {
chldcbs.insert (New child (pid, cb));
}
}
开发者ID:gildafnai82,项目名称:craq,代码行数:19,代码来源:core.C
示例7:
void
nodelete_remptr (const void *obj, const char *fl, int *fp)
{
if (do_nodelete ())
for (objref *oref = objreftab[obj]; oref; oref = objreftab.nextkeq (oref))
if (oref->refline == fl && oref->flagp == fp) {
delete oref;
return;
}
}
开发者ID:gildafnai82,项目名称:craq,代码行数:10,代码来源:malloc.C
示例8: strbuf
static inline rpcstats *
getstats (int progno, int procno)
{
str key = strbuf ("%d:%d", progno, procno);
rpcstats *stats = rpc_stats_tab[key];
if (!stats) {
stats = New rpcstats (key);
rpc_stats_tab.insert (stats);
}
return stats;
}
开发者ID:UMKC-BigDataLab,项目名称:XGossip,代码行数:11,代码来源:comm.C
示例9: fhtimer
fhtimer *
closesim::fhalloc (const nfs_fh3 &fh)
{
fhtimer *fht = New fhtimer (this, fh);
fht->expire = sfs_get_timenow() + closesim_minlife;
fq->minopen--;
fq->timeq.insert (fht);
fhtab.insert (fht);
fq->fhclean ();
return fht;
}
开发者ID:gildafnai82,项目名称:craq,代码行数:11,代码来源:closesim.C
示例10: update
void
get_cb (chordID next)
{
draw_ring ();
if (get_queue.size ()) {
chordID n = get_queue.pop_front ();
f_node *nu = nodes[n];
if (nu)
update (nu);
} else {
f_node *node_next = nodes[next];
if (node_next == NULL)
node_next = nodes.first ();
if (node_next) {
update (node_next);
node_next = nodes.next (node_next);
if (node_next == NULL)
node_next = nodes.first ();
next = node_next->ID;
} // else no nodes, keep calling get_cb until there are some
}
delaycb (0, 1000*1000*interval, wrap (&get_cb, next));
}
开发者ID:Amit-DU,项目名称:dht,代码行数:24,代码来源:vis_update.C
示例11: sfsserv
client::client (ref<axprt_crypt> x)
: sfsserv (x), fsrv (NULL), generation (nextgen ())
{
nfssrv = asrv::alloc (x, ex_nfs_program_3,
wrap (mkref (this), &client::nfs3pre_acl_dispatch));
nfscbc = aclnt::alloc (x, ex_nfscb_program_3);
char sfs_owner[] = SFSOWNER;
struct passwd *pw = getpwnam (sfs_owner);
int u_sfs = pw->pw_uid;
int g_sfs = pw->pw_gid;
int g_sock = pw->pw_gid; //fixme: put something different!
int g_fifo = pw->pw_gid; //likewise
auth_sfs = authunix_create ("localhost", u_sfs, g_sfs, 0, NULL);
auth_sfssock = authunix_create ("localhost", u_sfs, g_sock, 0, NULL);
auth_sfsfifo = authunix_create ("localhost", u_sfs, g_fifo, 0, NULL);
clienttab.insert (this);
}
开发者ID:bougyman,项目名称:sfs,代码行数:21,代码来源:client.C
示例12: mkref
void
mget_state_t::load_batches (const dsdc_hash_ring_t &r)
{
for (u_int i = 0; i < n; i++) {
dsdc_key_t k = (*keys)[i];
dsdc_ring_node_t *n = r.successor (k);
(*res)[i].key = k;
if (!n) {
(*res)[i].res.set_status (DSDC_NONODE);
} else {
ptr<aclnt_wrap_t> w = n->get_aclnt_wrap ();
mget_batch_t *batch;
str id = w->remote_peer_id ();
if (!(batch = batches[id])) {
batch = New mget_batch_t (id, w, mkref (this));
batches.insert (batch);
}
batch->arg.push_back (k);
batch->positions.push_back (i);
}
}
}
开发者ID:bowlofstew,项目名称:dsdc,代码行数:22,代码来源:smartcli_mget.C
示例13:
void
mget_state_t::dispatch_slaves ()
{
batches.traverse (wrap (this, &mget_state_t::dispatch_slave));
}
开发者ID:bowlofstew,项目名称:dsdc,代码行数:5,代码来源:smartcli_mget.C
示例14: obj
inline
objref::objref (const void *o, const char *fl, int *fp)
: obj (o), refline (fl), flagp (fp)
{
objreftab.insert (this);
}
开发者ID:gildafnai82,项目名称:craq,代码行数:6,代码来源:malloc.C
示例15:
client::~client ()
{
clienttab.remove (this);
}
开发者ID:bougyman,项目名称:sfs,代码行数:4,代码来源:client.C
示例16:
afsdirentry::~afsdirentry ()
{
node->remlink ();
dir->entries.remove (this);
cookietab.remove (this);
}
开发者ID:gildafnai82,项目名称:craq,代码行数:6,代码来源:afsdir.C
示例17:
sfssrv_exec::~sfssrv_exec ()
{
exectab.remove (this);
}
开发者ID:dougc333,项目名称:sfs_eventdrivenc--templatelibrary,代码行数:4,代码来源:sfssd.C
示例18: argv
sfssrv_exec::sfssrv_exec (const vec<str> &av)
: argv (av)
{
assert (!argv.empty ());
exectab.insert (this);
}
开发者ID:dougc333,项目名称:sfs_eventdrivenc--templatelibrary,代码行数:6,代码来源:sfssd.C
注:本文中的ihash类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论