本文整理汇总了C++中ep函数的典型用法代码示例。如果您正苦于以下问题:C++ ep函数的具体用法?C++ ep怎么用?C++ ep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ep函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
ReturnOop VMEvent::get_event_request(DebuggerEvent *d_event,
int &event_count, jbyte &suspend_policy)
{
VMEventStream es;
UsingFastOops fast_oops;
VMEvent::Fast ep, epp;
VMEventModifier::Fast em;
bool matched;
jbyte kind = d_event->event_kind();
event_count = 0;
suspend_policy = 0;
ep = es.next_by_kind(kind);
while(!ep.is_null()) {
bool should_delete = false;
// check modifiers
#if ENABLE_ISOLATES
// Check to see what task this event was requested on
if (ep().task_id() != -1 &&
(Thread::current()->task_id() != ep().task_id())) {
ep = es.next_by_kind(kind);
continue;
}
#endif
em = ep().mods();
// we need to check the modifiers to see if we send this event
matched = true;
do {
if (em.is_null()) {
break;
}
if (!em().match(d_event, &should_delete)) {
matched = false;
break;
}
em = em().next();
} while(em.not_null());
if (matched) {
// Found a matching event, join it to the list of events to send
ep().set_send_next(&epp);
epp = ep;
event_count++;
if (ep().suspend_policy() > suspend_policy) {
suspend_policy = ep().suspend_policy();
}
}
if (should_delete) {
clear_event_request(&ep);
}
ep = es.next_by_kind(kind);
}
return epp;
}
示例2: MCHandleUpdateContact
Exec_stat MCHandleUpdateContact(void *context, MCParameter *p_parameters) // ABUnknownPersonViewController
{
MCExecPoint ep(nil, nil, nil);
MCExecContext ctxt(ep);
// Handle parameters. We are doing that in a dedicated call
MCVariableValue *t_contact = nil;
char *t_title = nil;
char *t_message = nil;
char *t_alternate_name = nil;
/* UNCHECKED */ MCContactParseParams(p_parameters, t_contact, t_title, t_message, t_alternate_name);
// Call the Exec implementation
MCUpdateContactExec(ctxt, t_contact, t_title, t_message, t_alternate_name);
// Set return value
return ctxt.GetStat();
}
示例3: checkIfNodeInUse
bool checkIfNodeInUse(IpAddress &ip, bool includespares, StringBuffer &clustname)
{
SocketEndpoint ep(0,ip);
if (RANK_NULL != group->rank(ep)) {
clustname.append(groupName);
return true;
}
else if (includespares) {
if (RANK_NULL != spareGroup->rank(ep)) {
clustname.append(groupName).append(" spares");
return true;
}
}
return false;
}
示例4: openLibrary
void EffectsExporter::exportEffects(Scene *sce)
{
this->scene = sce;
if (this->export_settings->export_texture_type == BC_TEXTURE_TYPE_MAT) {
if (hasEffects(sce)) {
MaterialFunctor mf;
openLibrary();
mf.forEachMaterialInExportSet<EffectsExporter>(sce, *this, this->export_settings->export_set);
closeLibrary();
}
}
else {
std::set<Object *> uv_textured_obs = bc_getUVTexturedObjects(sce, !this->export_settings->active_uv_only);
std::set<Image *> uv_images = bc_getUVImages(sce, !this->export_settings->active_uv_only);
if (uv_images.size() > 0) {
openLibrary();
std::set<Image *>::iterator uv_images_iter;
for (uv_images_iter = uv_images.begin();
uv_images_iter != uv_images.end();
uv_images_iter++)
{
Image *ima = *uv_images_iter;
std::string key(id_name(ima));
key = translate_id(key);
COLLADASW::Sampler sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D,
key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX,
key + COLLADASW::Sampler::SURFACE_SID_SUFFIX);
sampler.setImageId(key);
openEffect(key + "-effect");
COLLADASW::EffectProfile ep(mSW);
ep.setProfileType(COLLADASW::EffectProfile::COMMON);
ep.setShaderType(COLLADASW::EffectProfile::PHONG);
ep.setDiffuse(createTexture(ima, key, &sampler), false, "diffuse");
COLLADASW::ColorOrTexture cot = getcol(0, 0, 0, 1.0f);
ep.setSpecular(cot, false, "specular");
ep.openProfile();
ep.addProfileElements();
ep.addExtraTechniques(mSW);
ep.closeProfile();
closeEffect();
}
closeLibrary();
}
}
}
示例5: GetReLULayer
shared_ptr<Layer<Dtype> > GetReLULayer(const LayerParameter& param) {
ReLUParameter_Engine engine = param.relu_param().engine();
// New, more flexible way of providing engine
if (engine == ReLUParameter_Engine_DEFAULT && param.engine() != "") {
EngineParser ep(param.engine());
if (ep.isEngine("CAFFE"))
engine = ReLUParameter_Engine_CAFFE;
#ifdef USE_CUDNN
else if (ep.isEngine("CUDNN"))
engine = ReLUParameter_Engine_CUDNN;
#endif
#if defined(MKL2017_SUPPORTED)
else if (ep.isEngine("MKL2017"))
engine = ReLUParameter_Engine_MKL2017;
#endif
#if defined(MKLDNN_SUPPORTED)
else if (ep.isEngine("MKLDNN"))
engine = ReLUParameter_Engine_MKLDNN;
#endif
}
if (engine == ReLUParameter_Engine_DEFAULT) {
engine = ReLUParameter_Engine_CAFFE;
#ifdef USE_CUDNN
engine = ReLUParameter_Engine_CUDNN;
#endif
}
if (engine == ReLUParameter_Engine_CAFFE) {
return shared_ptr<Layer<Dtype> >(new ReLULayer<Dtype>(param));
#ifdef USE_CUDNN
} else if (engine == ReLUParameter_Engine_CUDNN) {
return shared_ptr<Layer<Dtype> >(new CuDNNReLULayer<Dtype>(param));
#endif
#ifdef MKL2017_SUPPORTED
} else if (engine == ReLUParameter_Engine_MKL2017) {
return shared_ptr<Layer<Dtype> >(new MKLReLULayer<Dtype>(param));
#endif
#ifdef MKLDNN_SUPPORTED
} else if (engine == ReLUParameter_Engine_MKLDNN) {
return shared_ptr<Layer<Dtype> >(new MKLDNNReLULayer<Dtype>(param));
#endif
} else {
LOG(FATAL) << "Layer " << param.name() << " has unknown engine.";
}
return shared_ptr<Layer<Dtype> >();
}
示例6: clientTask
void clientTask(const RCF::tstring & pipeName, boost::uint32_t waitMs)
{
RCF::NamedPipeEndpoint ep(pipeName);
RcfClient<I_Echo> client(ep);
boost::uint32_t t0 = RCF::getCurrentTimeMs();
std::string s1 = "asdf";
std::string s2 = client.echo(s1, waitMs);
RCF_CHECK_EQ(s1 , s2);
boost::uint32_t t1 = RCF::getCurrentTimeMs();
RCF::Lock lock(gIoMutex);
std::cout << "Waited " << t1-t0 << " ms..." << std::endl;
}
示例7: ep
//-----------------------------------------------------------------------------
// Network stuff
void EventManager::listen(const int port)
{
dbglog << "EventManager: Listening on port " << port << " ...";
boost::asio::ip::tcp::endpoint ep(boost::asio::ip::tcp::v4(), port);
if (!mAcceptor)
{
mAcceptor = new boost::asio::ip::tcp::acceptor(mService, ep);
startAccept();
}
else
{
throw std::logic_error("EventManager::init(): Initialized twice!");
}
}
示例8: p
const RecentEmojiPack &cGetRecentEmojis() {
if (cRecentEmojis().isEmpty() && !cRecentEmojisPreload().isEmpty()) {
RecentEmojiPreload p(cRecentEmojisPreload());
cSetRecentEmojisPreload(RecentEmojiPreload());
RecentEmojiPack r;
r.reserve(p.size());
for (RecentEmojiPreload::const_iterator i = p.cbegin(), e = p.cend(); i != e; ++i) {
EmojiPtr ep(getEmoji(i->first));
if (ep) {
r.push_back(qMakePair(ep, i->second));
}
}
cSetRecentEmojis(r);
}
return cRecentEmojis();
}
示例9: MCHandleAdCreate
Exec_stat MCHandleAdCreate(void *context, MCParameter *p_parameters)
{
bool t_success;
t_success = true;
MCExecPoint ep(nil, nil, nil);
MCExecContext t_ctxt(ep);
t_ctxt . SetTheResultToEmpty();
char *t_ad;
t_ad = nil;
if (t_success)
t_success = MCParseParameters(p_parameters, "s", &t_ad);
MCAdType t_type;
t_type = kMCAdTypeUnknown;
if (t_success)
{
char *t_type_string;
t_type_string = nil;
if (MCParseParameters(p_parameters, "s", &t_type_string))
t_type = MCAdTypeFromCString(t_type_string);
MCCStringFree(t_type_string);
}
MCAdTopLeft t_top_left = {0,0};
if (t_success)
{
char *t_top_left_string;
t_top_left_string = nil;
if (MCParseParameters(p_parameters, "s", &t_top_left_string))
/* UNCHECKED */ sscanf(t_top_left_string, "%u,%u", &t_top_left.x, &t_top_left.y);
MCCStringFree(t_top_left_string);
}
MCVariableValue *t_meta_data;
t_meta_data = nil;
if (t_success)
MCParseParameters(p_parameters, "a", &t_meta_data);
if (t_success)
MCAdExecCreateAd(t_ctxt, t_ad, t_type, t_top_left, t_meta_data);
MCCStringFree(t_ad);
return t_ctxt.GetStat();
}
示例10: GetDeconvolutionLayer
shared_ptr<Layer<Dtype> > GetDeconvolutionLayer(
const LayerParameter& param) {
ConvolutionParameter conv_param = param.convolution_param();
ConvolutionParameter_Engine engine = conv_param.engine();
#if defined(MKL2017_SUPPORTED)
bool use_dilation = false;
for (int i = 0; i < conv_param.dilation_size(); ++i) {
if (conv_param.dilation(i) > 1) {
use_dilation = true;
}
}
#endif
// New, more flexible way of providing engine
if (engine == ConvolutionParameter_Engine_DEFAULT && param.engine() != "") {
EngineParser ep(param.engine());
if (ep.isEngine("CAFFE")) {
engine = ConvolutionParameter_Engine_CAFFE;
}
#ifdef MKL2017_SUPPORTED
else if (!use_dilation && ep.isEngine("MKL2017")) {
engine = ConvolutionParameter_Engine_MKL2017;
}
#endif
}
if (engine == ConvolutionParameter_Engine_DEFAULT) {
engine = ConvolutionParameter_Engine_CAFFE;
}
if (engine == ConvolutionParameter_Engine_CAFFE) {
return shared_ptr<Layer<Dtype> >(new DeconvolutionLayer<Dtype>(param));
#ifdef MKL2017_SUPPORTED
} else if (engine == ConvolutionParameter_Engine_MKL2017) {
if (use_dilation) {
LOG(FATAL) << "MKL2017 doesn't support the dilated convolution at Layer "
<< param.name();
}
return shared_ptr<Layer<Dtype> >(new MKLDeconvolutionLayer<Dtype>(param));
#endif
} else {
LOG(FATAL) << "Layer " << param.name() << " has unknown engine.";
}
return shared_ptr<Layer<Dtype> >();
}
示例11: main
int main()
{
try {
io::endpoint ep("127.0.0.1",8080);
TEST(ep.ip()=="127.0.0.1");
TEST(ep.port() == 8080);
ep.ip("192.168.2.100");
TEST(ep.ip()=="192.168.2.100");
ep.port(10);
TEST(ep.port()==10);
TEST(ep.family()==io::pf_inet);
#ifndef BOOSTER_AIO_NO_PF_INET6
ep.ip("::1");
TEST(ep.family()==io::pf_inet6);
#endif
#ifndef BOOSTER_WIN32
ep.path("/tmp/test");
TEST(ep.path()=="/tmp/test");
TEST(ep.family()==io::pf_unix);
#endif
ep=io::endpoint("127.0.0.1",8080);
io::acceptor a;
a.open(io::pf_inet);
#ifndef BOOSTER_WIN32
a.set_option(io::basic_socket::reuse_address,true);
#endif
a.bind(ep);
a.listen(1);
io::stream_socket s1;
s1.open(io::pf_inet);
s1.connect(ep);
io::stream_socket s2;
a.accept(s2);
io::endpoint rep = s2.remote_endpoint();
TEST(rep.family()==io::pf_inet);
TEST(rep.ip()=="127.0.0.1");
}
catch(std::exception const &e)
{
std::cerr<<"Failed:"<< e.what() << std::endl;
return 1;
}
std::cout << "Ok" << std::endl;
return 0;
}
示例12: ERR_FAIL_INDEX_V
bool EditorData::check_and_update_scene(int p_idx) {
ERR_FAIL_INDEX_V(p_idx,edited_scene.size(),false);
if (!edited_scene[p_idx].root)
return false;
Set<String> checked_scenes;
bool must_reload = _find_updated_instances(edited_scene[p_idx].root,edited_scene[p_idx].root,checked_scenes);
if (must_reload) {
Ref<PackedScene> pscene;
pscene.instance();
EditorProgress ep("update_scene","Updating Scene",2);
ep.step("Storing local changes..",0);
//pack first, so it stores diffs to previous version of saved scene
Error err = pscene->pack(edited_scene[p_idx].root);
ERR_FAIL_COND_V(err!=OK,false);
ep.step("Updating scene..",1);
Node *new_scene = pscene->instance(true);
ERR_FAIL_COND_V(!new_scene,false);
//transfer selection
List<Node*> new_selection;
for (List<Node*>::Element *E=edited_scene[p_idx].selection.front();E;E=E->next()) {
NodePath p = edited_scene[p_idx].root->get_path_to(E->get());
Node *new_node = new_scene->get_node(p);
if (new_node)
new_selection.push_back(new_node);
}
new_scene->set_filename( edited_scene[p_idx].root->get_filename() );
memdelete(edited_scene[p_idx].root);
edited_scene[p_idx].root=new_scene;
edited_scene[p_idx].selection=new_selection;
return true;
}
return false;
}
示例13: ep
void Client::Connect(const std::string& ip_addr, int port)
{
boost::asio::ip::tcp::endpoint ep(boost::asio::ip::address_v4::from_string(ip_addr), port);
socket_.async_connect(ep, boost::bind(&Client::OnConnect, this, _1));
for (;;)
{
try{
io_service_.run();
break;
}
catch (const std::exception& ex)
{
std::cout << "io_service_ exception: " << ex.what() << std::endl;
}
}
}
示例14: DOUT
void RemoteProxyHost::start()
{
if (this->m_thread.is_running())
{
DOUT(this->dinfo() << "RemoteProxyHost already running on port: " << this->m_local_port);
return;
}
// We do the following because we want it done in the main thread, so exceptions during start are propagated through.
// In particular we want to ensure that we dont have 2 servers with the same port number.
this->dolog(this->dinfo() + std::string("opening connection on port: ") + mylib::to_string(this->m_local_port));
boost::asio::ip::tcp::endpoint ep(boost::asio::ip::tcp::v4(), this->m_local_port);
this->m_acceptor.open(ep.protocol());
this->m_acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(false));
this->m_acceptor.bind(ep);
DOUT(this->dinfo() << "Bind ok for " << ep);
this->m_thread.start( [this]{ this->threadproc(); } );
}
示例15: ep
bool CNetConnector::ReConnect()
{
boost::asio::ip::tcp::socket *pNewSocket = new boost::asio::ip::tcp::socket(m_ioService);
if (nullptr == pNewSocket)
{
return false;
}
m_pAsioSocket = pNewSocket;
boost::asio::ip::tcp::endpoint ep(boost::asio::ip::address::from_string(m_strRemoteIP.c_str()), m_wRemotePort);
m_pAsioSocket->async_connect(ep,
bind(&CNetConnector::OnConnect, this, boost::asio::placeholders::error));
return true;
}