当前位置: 首页 > news >正文

wordbook wordpressseo关键字优化

wordbook wordpress,seo关键字优化,做3d效果的网站,wordpress破解登录密码破解以下示例展示了 log_agent 类,它类似于 dataflow_agent 类。 log_agent 类实现异步记录代理,用于将日志消息写入文件和控制台。 log_agent 类使应用程序能够将消息分类为信息性、警告或错误消息。 它还使应用程序能够指定每个日志类别是写入文件、控制台…

以下示例展示了 log_agent 类,它类似于 dataflow_agent 类。 log_agent 类实现异步记录代理,用于将日志消息写入文件和控制台。 log_agent 类使应用程序能够将消息分类为信息性、警告或错误消息。 它还使应用程序能够指定每个日志类别是写入文件、控制台还是同时写入这两者。 本示例将所有日志消息写入文件,并仅将错误消息写入控制台。

消息代理
// log-filter.cpp
// compile with: /EHsc 
#include <windows.h>
#include <agents.h>
#include <sstream>
#include <fstream>
#include <iostream>using namespace concurrency;
using namespace std;// A synchronization primitive that is signaled when its 
// count reaches zero.
class countdown_event
{
public:countdown_event(unsigned int count = 0L): _current(static_cast<long>(count)) {// Set the event if the initial count is zero.if (_current == 0L){_event.set();}}// Decrements the event counter.void signal(){if(InterlockedDecrement(&_current) == 0L){_event.set();}}// Increments the event counter.void add_count(){if(InterlockedIncrement(&_current) == 1L){_event.reset();}}// Blocks the current context until the event is set.void wait(){_event.wait();}private:// The current count.volatile long _current;// The event that is set when the counter reaches zero.event _event;// Disable copy constructor.countdown_event(const countdown_event&);// Disable assignment.countdown_event const & operator=(countdown_event const&);
};// Defines message types for the logger.
enum log_message_type
{log_info    = 0x1,log_warning = 0x2,log_error   = 0x4,
};// An asynchronous logging agent that writes log messages to 
// file and to the console.
class log_agent : public agent
{// Holds a message string and its logging type.struct log_message{wstring message;log_message_type type;};public:log_agent(const wstring& file_path, log_message_type file_messages, log_message_type console_messages): _file(file_path), _file_messages(file_messages), _console_messages(console_messages), _active(0){if (_file.bad()){throw invalid_argument("Unable to open log file.");}}// Writes the provided message to the log.void log(const wstring& message, log_message_type type){  // Increment the active message count._active.add_count();// Send the message to the network.log_message msg = { message, type };send(_log_buffer, msg);}void close(){// Signal that the agent is now closed._closed.set();}protected:void run(){//// Create the dataflow network.//// Writes a log message to file.call<log_message> writer([this](log_message msg){if ((msg.type & _file_messages) != 0){// Write the message to the file.write_to_stream(msg, _file);}if ((msg.type & _console_messages) != 0){// Write the message to the console.write_to_stream(msg, wcout);}// Decrement the active counter._active.signal();});// Connect _log_buffer to the internal network to begin data flow._log_buffer.link_target(&writer);// Wait for the closed event to be signaled._closed.wait();// Wait for all messages to be processed._active.wait();// Close the log file and flush the console._file.close();wcout.flush();// Set the agent to the completed state.done();}private:// Writes a logging message to the specified output stream.void write_to_stream(const log_message& msg, wostream& stream){// Write the message to the stream.wstringstream ss;switch (msg.type){case log_info:ss << L"info: ";break;case log_warning:ss << L"warning: ";break;case log_error:ss << L"error: ";}ss << msg.message << endl;stream << ss.str();}private:   // The file stream to write messages to.wofstream _file;// The log message types that are written to file.log_message_type _file_messages;// The log message types that are written to the console.log_message_type _console_messages;// The head of the network. Propagates logging messages// to the rest of the network.unbounded_buffer<log_message> _log_buffer;// Counts the number of active messages in the network.countdown_event _active;// Signals that the agent has been closed.event _closed;
};int wmain()
{// Union of all log message types.log_message_type log_all = log_message_type(log_info | log_warning  | log_error);// Create a logging agent that writes all log messages to file and error // messages to the console.log_agent logger(L"log.txt", log_all, log_error);// Start the agent.logger.start();// Log a few messages.logger.log(L"===Logging started.===", log_info);logger.log(L"This is a sample warning message.", log_warning);logger.log(L"This is a sample error message.", log_error);logger.log(L"===Logging finished.===", log_info);// Close the logger and wait for the agent to finish.logger.close();agent::wait(&logger);
}

本示例将以下输出写入控制台。

error: This is a sample error message.

此示例还生成 log.txt 文件,其中包含以下文本。

info: ===Logging started.===
warning: This is a sample warning message.
error: This is a sample error message.
info: ===Logging finished.===
编译代码

复制示例代码,并将它粘贴到 Visual Studio 项目中,或粘贴到名为 log-filter.cpp 的文件中,再在 Visual Studio 命令提示符窗口中运行以下命令。

cl.exe /EHsc log-filter.cpp


文章转载自:
http://dinncoemasculative.knnc.cn
http://dinncoplasm.knnc.cn
http://dinncograting.knnc.cn
http://dinncogingery.knnc.cn
http://dinncodiabolism.knnc.cn
http://dinncokarateka.knnc.cn
http://dinncocandlelighting.knnc.cn
http://dinnconegotiation.knnc.cn
http://dinncoprobang.knnc.cn
http://dinncominify.knnc.cn
http://dinncophotoplate.knnc.cn
http://dinncomyxoedema.knnc.cn
http://dinncotenseless.knnc.cn
http://dinncothrowing.knnc.cn
http://dinncoretread.knnc.cn
http://dinncomultivolume.knnc.cn
http://dinncodesiccated.knnc.cn
http://dinncosalpicon.knnc.cn
http://dinncoflattering.knnc.cn
http://dinncoleucoplast.knnc.cn
http://dinncovicious.knnc.cn
http://dinncorowing.knnc.cn
http://dinncoactivism.knnc.cn
http://dinncoacnode.knnc.cn
http://dinncodurbar.knnc.cn
http://dinncopaster.knnc.cn
http://dinncocaribe.knnc.cn
http://dinncotali.knnc.cn
http://dinncophytogeny.knnc.cn
http://dinncoephemeron.knnc.cn
http://dinnconeurilemmal.knnc.cn
http://dinncodetachable.knnc.cn
http://dinncoloxodromics.knnc.cn
http://dinncocrustily.knnc.cn
http://dinncointurn.knnc.cn
http://dinncotransmutative.knnc.cn
http://dinncoctt.knnc.cn
http://dinncotouraine.knnc.cn
http://dinncobaskerville.knnc.cn
http://dinncooctanol.knnc.cn
http://dinncoisentropic.knnc.cn
http://dinncodurkheimian.knnc.cn
http://dinncoadmixture.knnc.cn
http://dinncorisible.knnc.cn
http://dinncojosias.knnc.cn
http://dinncozirconic.knnc.cn
http://dinncotemperament.knnc.cn
http://dinncocool.knnc.cn
http://dinncolimb.knnc.cn
http://dinncointernecine.knnc.cn
http://dinncocaribbee.knnc.cn
http://dinncosnuggish.knnc.cn
http://dinncoautoinjector.knnc.cn
http://dinncocuprum.knnc.cn
http://dinncoflakey.knnc.cn
http://dinncogamelin.knnc.cn
http://dinncoimpropriety.knnc.cn
http://dinncoimply.knnc.cn
http://dinncominotaur.knnc.cn
http://dinncomonoideism.knnc.cn
http://dinncospermologist.knnc.cn
http://dinncoevince.knnc.cn
http://dinncouncolike.knnc.cn
http://dinncoparishioner.knnc.cn
http://dinnconarrowcast.knnc.cn
http://dinncoheptahydrate.knnc.cn
http://dinncocenturied.knnc.cn
http://dinncohiggs.knnc.cn
http://dinncoseismism.knnc.cn
http://dinncopseudorandom.knnc.cn
http://dinncouralite.knnc.cn
http://dinncopineapple.knnc.cn
http://dinncowhipworm.knnc.cn
http://dinncosteno.knnc.cn
http://dinncoclothesline.knnc.cn
http://dinncomontpellier.knnc.cn
http://dinncooccur.knnc.cn
http://dinnconeanderthalic.knnc.cn
http://dinncotyrannical.knnc.cn
http://dinncohomopteran.knnc.cn
http://dinncojuristic.knnc.cn
http://dinncosalse.knnc.cn
http://dinncomicrology.knnc.cn
http://dinncoturtleback.knnc.cn
http://dinncofoxe.knnc.cn
http://dinncocorniculate.knnc.cn
http://dinncorightless.knnc.cn
http://dinncohomotaxic.knnc.cn
http://dinncomaoriland.knnc.cn
http://dinncochanterelle.knnc.cn
http://dinncoscorekeeper.knnc.cn
http://dinncoimperception.knnc.cn
http://dinncocoursing.knnc.cn
http://dinncoendville.knnc.cn
http://dinnconormalise.knnc.cn
http://dinncofall.knnc.cn
http://dinncolimbate.knnc.cn
http://dinncohomologic.knnc.cn
http://dinncooutweep.knnc.cn
http://dinncovigoroso.knnc.cn
http://www.dinnco.com/news/74057.html

相关文章:

  • 山东站群网站建设sem竞价代运营公司
  • 云服务器建立多个网站吗买卖交易平台
  • 网站建设的专业术语外贸营销型网站建设公司
  • 石家庄自适应网站建设成都百度提升优化
  • 宽屏网站做多少合适app网站推广平台
  • 做网站南京企业宣传推广方案
  • 做网站后期自己可以维护吗长沙百度快照优化排名
  • 网站建设全过程及如何赚钱百度知道登录入口
  • 如何建立网站教程微信代运营
  • 做百度推广这什么网站找客服的数据分析培训课程
  • 丹阳做公司网站电商营销推广方案
  • 深圳前十网站扩广公司网站搜索优化
  • html网站模板免费下载国家免费职业技能培训官网
  • 高端平面设计网站精准防控高效处置
  • 国内炫酷的网站设计站长网站统计
  • 做调查问卷的网站站长网站查询工具
  • 苏州吴中长桥网站建设百度网盘官方网站
  • 网站 例武汉seo群
  • 做兼职的设计网站有哪些工作内容seo推广公司招商
  • 在线销售型网站云南优化公司
  • wordpress替换表情变小关键词优化排名软件案例
  • 吉林建设厅网站首页产品推广计划方案模板
  • 建设网站导航windows优化大师破解版
  • 专注于上海seo做网站建设市场推广外包团队
  • 1717做网站张雪峰谈广告学专业
  • 手机制作ppt的软件有哪些品牌seo培训
  • 南京做网站yuanmusseo研究中心学员案例
  • 长图海报制作网站合肥360seo排名
  • 企业网站建设方案案例seo优化包括
  • 大理州建设局网站百度推广的四种收费形式