Coding Style to implement our own function new() -- when using vmm_data_member_begin
2010-12-13 13:10
561 查看
You can use following coding style to implement your own function new().
Please also make sure that:
1) Put “ `vmm_data_new(randTRans) “ before “`vmm_data_member_begin(randTRans) “
2) If there is any argument in your newly defined function new(), DO assign a default value to those arguments.
Class randTrans extends vmm_data
`vmm_data_new(randTRans)
functionnew(dispSysCfg sys_cfg=null,
dispFrameCfg frame_cfg=null); //assign a default value
super.new(this.log);
this.sys_cfg=sys_cfg;
this.frame_cfg=frame_cfg;
endfunction
`vmm_data_member_begin(randTRans)
`vmm_data_member_scalar_array( run , DO_ALL)
`vmm_data_member_scalar_array( level , DO_ALL)
`vmm_data_member_scalar(num_strobe , DO_ALL)
`vmm_data_member_scalar(first_run , DO_ALL)
`vmm_data_member_scalar(idle_time , DO_ALL)
`vmm_data_member_scalar(strobe_time , DO_ALL)
`vmm_data_member_end(randTRans)
endclass
Please also make sure that:
1) Put “ `vmm_data_new(randTRans) “ before “`vmm_data_member_begin(randTRans) “
2) If there is any argument in your newly defined function new(), DO assign a default value to those arguments.
Class randTrans extends vmm_data
`vmm_data_new(randTRans)
functionnew(dispSysCfg sys_cfg=null,
dispFrameCfg frame_cfg=null); //assign a default value
super.new(this.log);
this.sys_cfg=sys_cfg;
this.frame_cfg=frame_cfg;
endfunction
`vmm_data_member_begin(randTRans)
`vmm_data_member_scalar_array( run , DO_ALL)
`vmm_data_member_scalar_array( level , DO_ALL)
`vmm_data_member_scalar(num_strobe , DO_ALL)
`vmm_data_member_scalar(first_run , DO_ALL)
`vmm_data_member_scalar(idle_time , DO_ALL)
`vmm_data_member_scalar(strobe_time , DO_ALL)
`vmm_data_member_end(randTRans)
endclass
相关文章推荐
- Slow performance occurs when you copy data to a TCP server by using a Windows Sockets API program
- using语句下使用SqlDataReader异常:Invalid attempt to Read when reader is closed
- #455 – Using ItemContainerStyle to Bind Data Elements in a Collection to a Grid
- When to use DataContract and DataMember attributes?
- Fatal error: Call to a member function getData() on a non-object in /data/php/framework/exts/zii/wid
- Developers are hitting a problem due to tools.jar when using Checkstyle
- Slow performance occurs when you copy data to a TCP server by using a Windows Sockets API program
- 提示"illegal reference to data member'CPMAgentManageDlg::m_matrixMatrixSt'in a static member function"
- How to correctly read data when using epoll_wait
- How to output the message when using the function 'printf'
- Linux - How to remove the new line at the end of file when using vim
- 1202530 - Error: "HTTP Status 500"" when attempting to log on to Java InfoView using Active Directory(配置BOSSO出现的问题解决方案)
- C++对象模型——指向Member Function的指针 (Pointer-to-Member Functions)(第四章)
- dedecms中自定义模型遇到错误Fatal error: Call to a member function GetInnerText() on a non-object
- how to call c++ function in python coding in linux?
- Python Web-第三周-Networks and Sockets(Using Python to Access Web Data)
- Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier
- How to use an ActiveX script task to import data into a new Excel file
- 解决 ECMall 错误 Call to a member function get() on a non-object in frontend.base.php
- "Cannot declare member function ...to have static linkage"错误