2017-07-15 10:35:02 -05:00
<!DOCTYPE html>
<!-- [if IE 8]><html class="no - js lt - ie9" lang="en" > <![endif] -->
<!-- [if gt IE 8]><! --> < html class = "no-js" lang = "en" > <!-- <![endif] -->
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< title > 6. Encapsulating DbU — Coriolis 2 documentation< / title >
< link rel = "stylesheet" href = "../_static/SoC.css" type = "text/css" / >
< link rel = "top" title = "Coriolis 2 documentation" href = "../index.html" / >
< link rel = "up" title = "Hurricane Python/C++ API Tutorial" href = "index.html" / >
< link rel = "next" title = "7. No C++ Hurricane::Name encapsulation" href = "Name.html" / >
< link rel = "prev" title = "5. Case 3 - Non-DBo Standalone Classe" href = "NonDBo.html" / >
< script src = "_static/js/modernizr.min.js" > < / script >
< / head >
< body class = "wy-body-for-nav" role = "document" >
< div class = "wy-grid-for-nav" >
< nav data-toggle = "wy-nav-shift" class = "wy-nav-side" >
< div class = "wy-side-nav-search" >
< a href = "../index.html" class = "icon icon-home" > Coriolis
< / a >
< div role = "search" >
< form id = "rtd-search-form" class = "wy-form" action = "../search.html" method = "get" >
< input type = "text" name = "q" placeholder = "Search docs" / >
< input type = "hidden" name = "check_keywords" value = "yes" / >
< input type = "hidden" name = "area" value = "default" / >
< / form >
< / div >
< / div >
< div class = "wy-menu wy-menu-vertical" data-spy = "affix" role = "navigation" aria-label = "main navigation" >
< ul class = "current" >
< li class = "toctree-l1" > < a class = "reference internal" href = "../UsersGuide/index.html" > Coriolis User’ s Guide< / a > < ul >
< li class = "toctree-l2" > < a class = "reference internal" href = "../UsersGuide/LicenseCredits.html" > Credits & License< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "../UsersGuide/Releases.html" > Release Notes< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Releases.html#release-1-0-1475" > Release 1.0.1475< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Releases.html#release-1-0-1963" > Release 1.0.1963< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Releases.html#release-1-0-2049" > Release 1.0.2049< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Releases.html#release-v2-0-1" > Release v2.0.1< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Releases.html#release-v2-1" > Release v2.1< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Releases.html#release-v2-2" > < strong > Release v2.2< / strong > < / a > < / li >
< / ul >
< / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "../UsersGuide/Installation.html" > Installation< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Installation.html#fixed-directory-tree" > Fixed Directory Tree< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Installation.html#building-coriolis" > Building Coriolis< / a > < ul >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/Installation.html#building-the-devel-branch" > Building the Devel Branch< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/Installation.html#additionnal-requirement-under-macos" > Additionnal Requirement under < span class = "sc" > MacOS< / span > < / a > < / li >
< / ul >
< / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Installation.html#packaging-coriolis" > Packaging Coriolis< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Installation.html#hooking-up-into-alliance" > Hooking up into < span class = "sc" > Alliance< / span > < / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Installation.html#setting-up-the-environment-coriolisenv-py" > Setting up the Environment (coriolisEnv.py)< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "../UsersGuide/Configuration.html" > Coriolis Configuration & Initialisation< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Configuration.html#general-software-architecture" > General Software Architecture< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Configuration.html#first-stage-symbolic-technology-selection" > First Stage: Symbolic Technology Selection< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Configuration.html#second-stage-technology-configuration-loading" > Second Stage: Technology Configuration Loading< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Configuration.html#configuration-helpers" > Configuration Helpers< / a > < ul >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/Configuration.html#alliance-helper" > < span class = "sc" > Alliance< / span > Helper< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/Configuration.html#tools-configuration-helpers" > Tools Configuration Helpers< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/Configuration.html#hacking-the-configuration-files" > Hacking the Configuration Files< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html" > CGT - The Graphical Interface< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#viewer-tools" > Viewer & Tools< / a > < ul >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#stratus-netlist-capture" > < span class = "sc" > Stratus< / span > Netlist Capture< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#the-hurricane-data-base" > The < span class = "sc" > Hurricane< / span > Data-Base< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#synthetizing-and-loading-a-design" > Synthetizing and loading a design< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#etesian-placer" > Etesian – Placer< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#knik-global-router" > Knik – Global Router< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#kite-detailed-router" > Kite – Detailed Router< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#executing-python-scripts-in-cgt" > Executing Python Scripts in Cgt< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#printing-snapshots" > Printing & Snapshots< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#memento-of-shortcuts-in-graphic-mode" > Memento of Shortcuts in Graphic Mode< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#cgt-command-line-options" > Cgt Command Line Options< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#miscellaneous-settings" > Miscellaneous Settings< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#the-controller" > The Controller< / a > < ul >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#the-look-tab" > The Look Tab< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#the-filter-tab" > The Filter Tab< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#the-layers-go-tab" > The Layers& Go Tab< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#the-netlist-tab" > The Netlist Tab< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#the-selection-tab" > The Selection Tab< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#the-inspector-tab" > The Inspector Tab< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ViewerTools.html#the-settings-tab" > The Settings Tab< / a > < / li >
< / ul >
< / li >
< / ul >
< / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "../UsersGuide/ScriptsPlugins.html" > Python Interface for < span class = "sc" > Hurricane< / span > / < span class = "sc" > Coriolis< / span > < / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/ScriptsPlugins.html#plugins" > Plugins< / a > < ul >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ScriptsPlugins.html#chip-placement" > Chip Placement< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ScriptsPlugins.html#clock-tree" > Clock Tree< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "../UsersGuide/ScriptsPlugins.html#recursive-save-rsave" > Recursive-Save (RSave)< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../UsersGuide/ScriptsPlugins.html#a-simple-example-am2901" > A Simple Example: AM2901< / a > < / li >
< / ul >
< / li >
< / ul >
< / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../Stratus/Stratus.html" > Stratus Reference< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../DpGen/DpGen.html" > DpGen Reference< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../Patterns/Patterns.html" > Patterns Reference< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../Hurricane/Hurricane.html" > Hurricane Reference< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../Viewer/Viewer.html" > Viewer Reference< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../CrlCore/CrlCore.html" > CRL Core Reference< / a > < / li >
2017-07-17 12:12:18 -05:00
< li class = "toctree-l1" > < a class = "reference internal" href = "../Katabatic/Katabatic.html" > Katabatic Reference< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../Kite/Kite.html" > Kite Reference< / a > < / li >
2017-07-15 10:35:02 -05:00
< li class = "toctree-l1" > < a class = "reference internal" href = "../Unicorn/Unicorn.html" > Unicorn Reference< / a > < / li >
< li class = "toctree-l1 current" > < a class = "reference internal" href = "index.html" > Hurricane Python/C++ API Tutorial< / a > < ul class = "current" >
< li class = "toctree-l2" > < a class = "reference internal" href = "Introduction.html" > 1. Introduction< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "Introduction.html#first-a-disclaimer" > 1.1 First, A Disclaimer< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "Introduction.html#about-technical-choices" > 1.2 About Technical Choices< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "Introduction.html#botched-design" > 1.3 Botched Design< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "Configuration.html" > 2. Basic File Structure and CMake configuration< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "DBoStandalone.html" > 3. Case 1 - DBo Derived, Standalone< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "DBoStandalone.html#class-associated-header-file" > 3.1 Class Associated Header File< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "DBoStandalone.html#class-associated-file" > 3.2 Class Associated File< / a > < ul >
< li class = "toctree-l4" > < a class = "reference internal" href = "DBoStandalone.html#head-of-the-file" > 3.2.1 Head of the file< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "DBoStandalone.html#the-python-module-part" > 3.2.2 The Python Module Part< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "DBoStandalone.html#python-type-linking" > 3.2.3 Python Type Linking< / a > < / li >
< li class = "toctree-l4" > < a class = "reference internal" href = "DBoStandalone.html#the-shared-library-part" > 3.2.4 The Shared Library Part< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "DBoStandalone.html#python-module-c-namespace" > 3.3 Python Module (C++ namespace)< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "DBoHierarchy.html" > 4. Case 2 - Hierarchy of DBo Derived Classes< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "DBoHierarchy.html#base-class-header" > 4.1 Base Class Header< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "DBoHierarchy.html#base-class-file" > 4.2 Base Class File< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "DBoHierarchy.html#intermediate-class-header" > 4.3 Intermediate Class Header< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "DBoHierarchy.html#intermediate-class-file" > 4.4 Intermediate Class File< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "DBoHierarchy.html#terminal-class-header" > 4.5 Terminal Class Header< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "DBoHierarchy.html#terminal-class-file" > 4.6 Terminal Class File< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "DBoHierarchy.html#python-module" > 4.8 Python Module< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "NonDBo.html" > 5. Case 3 - Non-DBo Standalone Classe< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "NonDBo.html#class-header" > 5.1 Class Header< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "NonDBo.html#class-file" > 5.2 Class File< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "NonDBo.html#id1" > 5.2 Class File< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l2 current" > < a class = "current reference internal" href = "" > 6. Encapsulating DbU< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "Name.html" > 7. No C++ Hurricane::Name encapsulation< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "../RDS/index.html" > Symbolic to Real Conversion in Alliance< / a > < ul >
< li class = "toctree-l2" > < a class = "reference internal" href = "../RDS/RDSpage.html" > Symbolic Layout< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "../RDS/RDSpage.html#symbolic-components" > Symbolic Components< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../RDS/RDSpage.html#symbolic-segments" > Symbolic Segments< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "../RDS/RDSpage.html#the-rds-file" > The RDS File< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "../RDS/RDSpage.html#physical-grid-lambda-value" > Physical Grid & Lambda Value< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../RDS/RDSpage.html#the-mbk-to-rds-segment-table" > The < tt class = "docutils literal" > < span class = "pre" > MBK_TO_RDS_SEGMENT< / span > < / tt > table< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../RDS/RDSpage.html#the-mbk-to-rds-via-table" > The < tt class = "docutils literal" > < span class = "pre" > MBK_TO_RDS_VIA< / span > < / tt > table< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../RDS/RDSpage.html#the-mbk-to-rds-bigvia-hole-table" > The < tt class = "docutils literal" > < span class = "pre" > MBK_TO_RDS_BIGVIA_HOLE< / span > < / tt > table< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../RDS/RDSpage.html#the-mbk-to-rds-bigvia-metal-table" > The < tt class = "docutils literal" > < span class = "pre" > MBK_TO_RDS_BIGVIA_METAL< / span > < / tt > table< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "../RDS/RDSpage.html#the-mbk-wiresetting-table" > The < tt class = "docutils literal" > < span class = "pre" > MBK_WIRESETTING< / span > < / tt > table< / a > < / li >
< / ul >
< / li >
< / ul >
< / li >
< / ul >
< / div >
< / nav >
< section data-toggle = "wy-nav-shift" class = "wy-nav-content-wrap" >
< nav class = "wy-nav-top" role = "navigation" aria-label = "top navigation" >
< i data-toggle = "wy-nav-top" class = "fa fa-bars" > < / i >
< a href = "../index.html" > Coriolis< / a >
< / nav >
< div class = "wy-nav-content" >
< div class = "rst-content" >
< div role = "navigation" aria-label = "breadcrumbs navigation" >
< ul class = "wy-breadcrumbs" >
< li > < a href = "../index.html" > Docs< / a > » < / li >
< li > < a href = "index.html" > Hurricane Python/C++ API Tutorial< / a > » < / li >
< li > 6. Encapsulating DbU< / li >
< li class = "wy-breadcrumbs-aside" >
< / li >
< / ul >
< hr / >
< / div >
< div role = "main" class = "document" >
< div class = "section" id = "encapsulating-dbu" >
< h1 > 6. Encapsulating DbU< a class = "headerlink" href = "#encapsulating-dbu" title = "Permalink to this headline" > ¶< / a > < / h1 >
< p > While < tt class = "docutils literal" > < span class = "pre" > Hurricane::DbU< / span > < / tt > is a class, the < tt class = "docutils literal" > < span class = "pre" > Hurricane::DbU::Unit< / span > < / tt > is only
a < tt class = "docutils literal" > < span class = "pre" > typedef< / span > < / tt > over < tt class = "docutils literal" > < span class = "pre" > uint64_t< / span > < / tt > . The < tt class = "docutils literal" > < span class = "pre" > DbU< / span > < / tt > class only provides a set of
static methods to manipulate and convert to and from other units.
At Python level, < tt class = "docutils literal" > < span class = "pre" > DbU::Unit< / span > < / tt > will be stored in plain < tt class = "docutils literal" > < span class = "pre" > long< / span > < span class = "pre" > long< / span > < / tt > .< / p >
< p > When a < tt class = "docutils literal" > < span class = "pre" > DbU::Unit< / span > < / tt > argument is expected in a Python functions, just use
the < tt class = "docutils literal" > < span class = "pre" > DbU::Unit< / span > < span class = "pre" > PyAny_AsLong(< / span > < span class = "pre" > PyObject*< / span > < span class = "pre" > )< / span > < / tt > function to convert it.< / p >
< p > For example, if we explicit the expension of:< / p >
< div class = "highlight-c++" > < div class = "highlight" > < pre > < span class = "n" > DirectSetLongAttribute< / span > < span class = "p" > (< / span > < span class = "n" > PyPoint_SetX< / span > < span class = "p" > ,< / span > < span class = "n" > setX< / span > < span class = "p" > ,< / span > < span class = "n" > PyPoint< / span > < span class = "p" > ,< / span > < span class = "n" > Point< / span > < span class = "p" > )< / span >
< / pre > < / div >
< / div >
< p > < / p >
< p > We would get:< / p >
< div class = "highlight-c++" > < div class = "highlight" > < pre > < span class = "k" > static< / span > < span class = "n" > PyObject< / span > < span class = "o" > *< / span > < span class = "n" > PyPoint_setX< / span > < span class = "p" > (< / span > < span class = "n" > PyPoint< / span > < span class = "o" > *< / span > < span class = "n" > self< / span > < span class = "p" > ,< / span > < span class = "n" > PyObject< / span > < span class = "o" > *< / span > < span class = "n" > args< / span > < span class = "p" > )< / span >
< span class = "p" > {< / span >
< span class = "n" > Point< / span > < span class = "o" > *< / span > < span class = "n" > cobject< / span > < span class = "o" > =< / span > < span class = "k" > static_cast< / span > < span class = "o" > < < / span > < span class = "n" > Point< / span > < span class = "o" > *> < / span > < span class = "p" > (< / span > < span class = "n" > self< / span > < span class = "o" > -> < / span > < span class = "n" > _object< / span > < span class = "p" > );< / span >
< span class = "k" > if< / span > < span class = "p" > (< / span > < span class = "n" > cobject< / span > < span class = "o" > ==< / span > < span class = "nb" > NULL< / span > < span class = "p" > )< / span > < span class = "p" > {< / span >
< span class = "n" > PyErr_SetString< / span > < span class = "p" > (< / span > < span class = "n" > ProxyError< / span >
< span class = "p" > ,< / span > < span class = "s" > " Attempt to call Point.setX() on an unbound Hurricane object" < / span > < span class = "p" > );< / span >
< span class = "k" > return< / span > < span class = "nb" > NULL< / span > < span class = "p" > ;< / span >
< span class = "p" > }< / span >
< span class = "n" > HTRY< / span >
< span class = "n" > PyObject< / span > < span class = "o" > *< / span > < span class = "n" > arg0< / span > < span class = "o" > =< / span > < span class = "nb" > NULL< / span > < span class = "p" > ;< / span >
< span class = "k" > if< / span > < span class = "p" > (< / span > < span class = "n" > not< / span > < span class = "n" > PyArg_ParseTuple< / span > < span class = "p" > (< / span > < span class = "n" > args< / span > < span class = "p" > ,< / span > < span class = "s" > " O:Point.setX()" < / span > < span class = "p" > ,< / span > < span class = "o" > & < / span > < span class = "n" > arg0< / span > < span class = "p" > ))< / span >
< span class = "k" > return< / span > < span class = "p" > (< / span > < span class = "nb" > NULL< / span > < span class = "p" > );< / span >
< span class = "n" > cobject< / span > < span class = "o" > -> < / span > < span class = "n" > setX< / span > < span class = "p" > (< / span > < span class = "n" > Isobar< / span > < span class = "o" > ::< / span > < span class = "n" > PyAny_AsLong< / span > < span class = "p" > (< / span > < span class = "n" > arg0< / span > < span class = "p" > )< / span > < span class = "p" > );< / span >
< span class = "n" > HCATCH< / span >
< span class = "n" > Py_RETURN_NONE< / span > < span class = "p" > ;< / span >
< span class = "p" > }< / span >
< / pre > < / div >
< / div >
< p > For the other way around, use < tt class = "docutils literal" > < span class = "pre" > PyObject*< / span > < span class = "pre" > PyDbU_FromLong(< / span > < span class = "pre" > DbU::Unit< / span > < span class = "pre" > )< / span > < / tt > .< / p >
< div class = "highlight-c++" > < div class = "highlight" > < pre > < span class = "n" > DirectGetLongAttribute< / span > < span class = "p" > (< / span > < span class = "n" > PyPoint_GetX< / span > < span class = "p" > ,< / span > < span class = "n" > getX< / span > < span class = "p" > ,< / span > < span class = "n" > PyPoint< / span > < span class = "p" > ,< / span > < span class = "n" > Point< / span > < span class = "p" > )< / span >
< / pre > < / div >
< / div >
< p > We would get:< / p >
< div class = "highlight-c++" > < div class = "highlight" > < pre > < span class = "k" > static< / span > < span class = "n" > PyObject< / span > < span class = "o" > *< / span > < span class = "n" > PyPoint_GetX< / span > < span class = "p" > (< / span > < span class = "n" > PyPoint< / span > < span class = "o" > *< / span > < span class = "n" > self< / span > < span class = "p" > ,< / span > < span class = "n" > PyObject< / span > < span class = "o" > *< / span > < span class = "n" > args< / span > < span class = "p" > )< / span >
< span class = "p" > {< / span >
< span class = "n" > Point< / span > < span class = "o" > *< / span > < span class = "n" > cobject< / span > < span class = "o" > =< / span > < span class = "k" > static_cast< / span > < span class = "o" > < < / span > < span class = "n" > Point< / span > < span class = "o" > *> < / span > < span class = "p" > (< / span > < span class = "n" > self< / span > < span class = "o" > -> < / span > < span class = "n" > _object< / span > < span class = "p" > );< / span >
< span class = "k" > if< / span > < span class = "p" > (< / span > < span class = "n" > cobject< / span > < span class = "o" > ==< / span > < span class = "nb" > NULL< / span > < span class = "p" > )< / span > < span class = "p" > {< / span >
< span class = "n" > PyErr_SetString< / span > < span class = "p" > (< / span > < span class = "n" > ProxyError< / span >
< span class = "p" > ,< / span > < span class = "s" > " Attempt to call Point.getX() on an unbound Hurricane object" < / span > < span class = "p" > );< / span >
< span class = "k" > return< / span > < span class = "nb" > NULL< / span > < span class = "p" > ;< / span >
< span class = "p" > }< / span >
< span class = "k" > return< / span > < span class = "n" > Isobar< / span > < span class = "o" > ::< / span > < span class = "n" > PyDbU_FromLong< / span > < span class = "p" > (< / span > < span class = "n" > cobject< / span > < span class = "o" > -> < / span > < span class = "n" > getX< / span > < span class = "p" > ());< / span >
< span class = "p" > }< / span >
< / pre > < / div >
< / div >
< / div >
< / div >
< footer >
< div class = "rst-footer-buttons" role = "navigation" aria-label = "footer navigation" >
< a href = "Name.html" class = "btn btn-neutral float-right" title = "7. No C++ Hurricane::Name encapsulation" accesskey = "n" > Next < span class = "fa fa-arrow-circle-right" > < / span > < / a >
< a href = "NonDBo.html" class = "btn btn-neutral" title = "5. Case 3 - Non-DBo Standalone Classe" accesskey = "p" > < span class = "fa fa-arrow-circle-left" > < / span > Previous< / a >
< / div >
< hr / >
< div role = "contentinfo" >
< table class = "footer1" >
< tr >
< td class = "LFooter" > < small >
Generated by < a href = "http://sphinx-doc.org/" > Sphinx< / a >
2017-07-17 12:12:18 -05:00
using a < a href = "https://readthedocs.org" > RTD< / a > theme on Jul 17, 2017.
2017-07-15 10:35:02 -05:00
< / small > < / td >
< td class = "RFooter" > < / td >
< / tr >
< / table >
< table class = "footer2" >
< tr >
< td class = "LFooter" > Coriolis 2 Documentation< / td >
< td class = "RFooter" > < small >
© Copyright 2000-2017, UPMC.
< / small > < / td >
< / tr >
< / table >
< / div >
< / footer >
< / div >
< / div >
< / section >
< / div >
< script type = "text/javascript" >
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'2',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
< / script >
< script type = "text/javascript" src = "../_static/jquery.js" > < / script >
< script type = "text/javascript" src = "../_static/underscore.js" > < / script >
< script type = "text/javascript" src = "../_static/doctools.js" > < / script >
< script type = "text/javascript" src = "../_static/js/theme.js" > < / script >
< script type = "text/javascript" >
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
< / script >
< / body >
< / html >