请帮忙会计科目详细解释释这个程序。

当前访客身份:游客 [
当前位置:
import inspect import logging import sys
LOG = logging.getLogger('ryu.controller.handler')
# just represent OF datapath state. datapath specific so should be moved. HANDSHAKE_DISPATCHER = "handshake" CONFIG_DISPATCHER = "config" MAIN_DISPATCHER = "main" DEAD_DISPATCHER = "dead"
class _Caller(object): &&& """Describe how to handle an event class. &&& """
&&& def __init__(self, dispatchers, ev_source): &&&&&&& """Initialize _Caller.
&&&&&&& :param dispatchers: A list of states or a state, in which this &&&&&&&&&&&&&&&&&&&&&&&&&&& is in effect. &&&&&&&&&&&&&&&&&&&&&&&&&&& None and [] mean all states. &&&&&&& :param ev_source: The module which generates the event. &&&&&&&&&&&&&&&&&&&&&&&&& ev_cls.__module__ for set_ev_cls. &&&&&&&&&&&&&&&&&&&&&&&&& None for set_ev_handler. &&&&&&& """ &&&&&&& self.dispatchers = dispatchers &&&&&&& self.ev_source = ev_source
# should be named something like 'observe_event' def set_ev_cls(ev_cls, dispatchers=None): &&& def _set_ev_cls_dec(handler): &&&&&&& if 'callers' not in dir(handler): &&&&&&&&&&& handler.callers = {} &&&&&&& for e in _listify(ev_cls): &&&&&&&&&&& handler.callers[e] = _Caller(_listify(dispatchers), e.__module__) &&&&&&& return handler &&& return _set_ev_cls_dec
def set_ev_handler(ev_cls, dispatchers=None): &&& def _set_ev_cls_dec(handler): &&&&&&& if 'callers' not in dir(handler): &&&&&&&&&&& handler.callers = {} &&&&&&& for e in _listify(ev_cls): &&&&&&&&&&& handler.callers[e] = _Caller(_listify(dispatchers), None) &&&&&&& return handler &&& return _set_ev_cls_dec
def _has_caller(meth): &&& return hasattr(meth, 'callers')
def _listify(may_list): &&& if may_list is None: &&&&&&& may_list = [] &&& if not isinstance(may_list, list): &&&&&&& may_list = [may_list] &&& return may_list
def register_instance(i): &&& for _k, m in inspect.getmembers(i, inspect.ismethod): &&&&&&& # LOG.debug('instance %s k %s m %s', i, _k, m) &&&&&&& if _has_caller(m): &&&&&&&&&&& for ev_cls, c in m.callers.iteritems(): &&&&&&&&&&&&&&& i.register_handler(ev_cls, m)
def get_dependent_services(cls): &&& services = [] &&& for _k, m in inspect.getmembers(cls, inspect.ismethod): &&&&&&& if _has_caller(m): &&&&&&&&&&& for ev_cls, c in m.callers.iteritems(): &&&&&&&&&&&&&&& service = getattr(sys.modules[ev_cls.__module__], &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& '_SERVICE_NAME', None) &&&&&&&&&&&&&&& if service: &&&&&&&&&&&&&&&&&&& # avoid cls that registers the own events (like &&&&&&&&&&&&&&&&&&& # ofp_handler) &&&&&&&&&&&&&&&&&&& if cls.__module__ != service: &&&&&&&&&&&&&&&&&&&&&&& services.append(service)
&&& m = sys.modules[cls.__module__] &&& services.extend(getattr(m, '_REQUIRED_APP', [])) &&& services = list(set(services)) &&& return services
def register_service(service): &&& """ &&& Register the ryu application specified by 'service' as &&& a provider of events defined in the calling module.
&&& If an application being loaded consumes events (in the sense of &&& set_ev_cls) provided by the 'service' application, the latter &&& application will be automatically loaded.
&&& This mechanism is used to e.g. automatically start ofp_handler if &&& there are applications consuming OFP events. &&& """ &&& frm = inspect.stack()[1] &&& m = inspect.getmodule(frm[0]) &&& m._SERVICE_NAME = service
共有0个答案
更多开发者职位上
有什么技术问题吗?
类似的话题请高手帮忙看一下这个VHDL编程题哪里有错,并请说明这个程序的作用, 请高手帮忙看一下这个VHDL编程
请高手帮忙看一下这个VHDL编程题哪里有错,并请说明这个程序的作用 LIBRARY IEEE;-- 1USE IEEE.STD_LOGIC_1164.ALL;-- 2ENTITY LED7SEG IS-- 3PORT (A
: IN STD_LOGIC_VECTOR(3 DOWNTO 0);-- 4CLK
: IN STD_LOGIC;-- 5LED7S : OUT STD_LOGIC_VECTOR(6 DOWNTO 0));-- 6END LED7SEG;-- 7ARCHITECTURE one OF LED7SEG IS-- 8SIGNAL TMP : STD_LOGIC;-- 9BEGIN-- 10SYNC : PROCESS(CLK, A)-- 11BEGIN-- 12IF CLK'EVENT AND CLK = '1' THEN-- 13TMP &= A;-- 14END IF;-- 15END PROCESS;-- 16OUTLED : PROCESS(TMP)-- 17BEGIN-- 18CASE TMP IS-- 19 WHEN &0000& =& LED7S &= &0111111&;-- 20 WHEN &0001& =& LED7S &= &0000110&;-- 21 WHEN 俯{牡饧熔郴赖镂ǘ&0010& =& LED7S &= &1011011&;-- 22 WHEN &0011& =& LED7S &= &1001111&;-- 23 WHEN &0100& =& LED7S &= &1100110&;-- 24 WHEN &0101& =& LED7S &= &1101101&;-- 25 WHEN &0110& =& LED7S &= &1111101&;-- 26 WHEN &0111& =& LED7S &= &0000111&;-- 27 WHEN &1000& =& LED7S &= &1111111&;-- 28 WHEN &1001& =& LED7S &= &1101111&;-- 29END CASE;-- 30END PROCESS;-- 31END-- 32 daisy2lau 请高手帮忙看一下这个VHDL编程题哪里有错,并请说明这个程序的作用
最重要俯{牡饧熔郴赖镂ǘさ拇砦螅1、SIGNAL TMP : STD_LOGIC;该语句改为SIGNAL TMP : STD_LOGIC_VECTOR(3 DOWNTO 0);2、第一个进程,SYNC : PROCESS(CLK, A)改为SYNC : PROCESS(CLK),即,敏感变量表中去掉A次要的不足:最好在case中的最后位置end case之前的位置加一个when others=&LED7S&=“0000000”;避免生成不必要的锁存器,当然这对功能仿真结果不会有影响。
这应该是一个根据输入A来决定7段码显示的程序,因为你的输入A是一个STD_LOGIC_VECTOR(3 DOWNTO 0)的数据类型,而在下边11~16行程序的作用是在时钟的上升沿CLK'EVENT AND CLK = '1' 时把A的值赋给TMP,所以TMP的数据类型应该和A一样,即STD_LOGIC_VECTOR(3 DOWNTO 0),而不是STD_LOGIC,还有下边19~30的case语句在end case之前最好加一个when o俯{牡饧熔郴赖镂ǘthers=&这样更好,以免出现不必要的错误。我也是初学者,希望可以对你有帮助~
你的定义有问题第九行改成:SIGNAL TMP : STD_LOGIC_vector(3 downto 0);就可以了
楼上的都回答的很完善了,赞!请大神帮忙解释下这段C++程序_百度知道
请大神帮忙解释下这段C++程序
就使用8554端口 } /) == 0) {
sms-& /#include &lt, reuseSource));创建交互环境 env = BasicUsageEwsock32:createNew(env:;/ / ServerMediaSession* sms = NULL, &quot, fileN;/addServerMediaSession(sms).264文件&//)#pragma comment(在session中添加subssesion &#47,'newVideoServerMediaSubsession());), &quot.:createNew(env, reuseSource));进行事件循环 env-&gt.lib&t&quot.264&quot?有大神帮我理理思路吗 详细的解释下这段程序的流程大致意思;打印服务器地址 *env &addSubsession(H264VideoFileServerMediaS
&t&quot:;n&, &&) == 0) {
sms-&BasicUsageEnvironment:;&#47.lib& } else if(strcmp(addSubsession(demux-&:.ts&quot:createNew(*scheduler).m4e&&&&#pragma comment( RTSPServer* rtspServer.hh& /& &#47.; } /int main(){ TaskScheduler* / UsageEnvironment*&#47:.h264&quot.&#92,&
sms-&gt,& } else if(strcmp(使用554端口 if(rtspServer == NULL) {
rtspServer = RTSPServer:createNew(env.&#39.hh&quot:; rtspServer-&libBasicUsageEnvironment:createNew(*n\addSubsession(MPEG4VideoFileServerMediaSaddSubsession(H264VideoFileServerMediaSubsession, fileName), fileNServer提供slamtv60.lib&) #pragma comment(lib:createNew(
if(strcmp(&#47.doEventLoop(), &&, fileN&#47.;创建一个session / / / //);libliveM#include &) static ServerMediaSession* createNewSMS(UsageEnvironment& env:;服务器连接正常准备启动;创建任务调用器 scheduler = BasicTaskS } else if(strcmp(/&不重用source sms = ServerMediaS/,char const* fileName){ char const* extension = strrchr(fileN;liveM ServerMediaSession* does not return
return 0,&quot.lib&quot, reuseSource)):createNew()#pragma comment(, fileNt& &添加其它文件对应的session。 #include &quot, reuseSource);&#47,&添加其它媒体格式支持; rtspServer-&gt, &quot:&#92这些函数名看不懂不要紧像前面static定义了一个函数后面越来越看不懂如果不定义直接把后面的程序写到前面可以吗;newAudioServerMediaSubsession());taskScheduler();&lt.:,char const* fileName):createNew(env:createNew(*env. / &n\&/addSubsession(H264VideoFileServerMediaS) == 0) {
sms-& Boolean reuseSource = False, fileN创建session sms = createNewSMS(*env, reuseSource)).; ///&#47:createNew():\libUsageE现在开始侦听Client,554);) == 0) {
sms-&创建RTSP服务器 rtspServer = RTSPSn&#92.h&
sms-&gt:\554端口被占用,&quot.;rtspURLPrefix() &lt.ts&quot.lib& &#47:;RTSPServer开启成功,8554); } {
MPEG1or2FileServerDemux* demux
= MPEG1or2FileServerD& &#47:.;}static ServerMediaSession* createNewSMS(UsageEnvironment&)#pragma comment(lib. addSubsession(demux-&gt
开始的是一个声明, fileName)创建一块域,在C++在中必需声明再使用,赋值内容由判断决定最后返回已经创建好的域地址,ServerMediaSession* sms创建一个指针sms = ServerMediaSession:,接下来就对它赋值:createNew(env。而static则是把这个函数声明在这个文件域域上
其他类似问题
为您推荐:
其他2条回答
加我QQ10086
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁请帮忙解释一下这段程序
[问题点数:40分,结帖人qvb1013]
请帮忙解释一下这段程序
[问题点数:40分,结帖人qvb1013]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
本帖子已过去太久远了,不再提供回复功能。

我要回帖

更多关于 会计科目表及详细解释 的文章

 

随机推荐