Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
science:EtherLab
PdCom
_service:obs_scm:pdcom-3.0.11.0.gfcbffda.obscpio
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:pdcom-3.0.11.0.gfcbffda.obscpio of Package PdCom
07070100000000000081A400000000000000000000000165BCF7870000018D000000000000000000000000000000000000002300000000pdcom-3.0.11.0.gfcbffda/.gitignore**.Plo **.Po **.lo **.o **.orig **.sw? **Makefile **Makefile.in **~ aclocal.m4 autoconf autom4te.cache config.h config.h.in config.log config.status configure doc/Doxyfile doc/html doc/latex doc/man example/.deps example/.libs example/example libtool m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 pdcom.spec src/.deps src/.libs src/libpdcom.la src/pdcom.h stamp-h1 07070100000001000081A400000000000000000000000165BCF7870000032F000000000000000000000000000000000000002700000000pdcom-3.0.11.0.gfcbffda/.gitlab-ci.ymlimage: registry.gitlab.com/etherlab.org/build-container-factory/leap-15.3:base stages: - build - test - doc - deploy build: stage: build script: - ./bootstrap.sh - mkdir build && cd build - ../configure - make -j4 artifacts: paths: - build doxygen: rules: - if: '$CI_COMMIT_BRANCH == "stable-3.0"' variables: GIT_SUBMODULE_STRATEGY: recursive needs: [build] stage: doc image: registry.gitlab.com/etherlab.org/build-container-factory/leap-15.3:texlive script: - cd build/doc && doxygen Doxyfile && cd ../.. - mv build/doc/html . artifacts: paths: - html workflow: rules: - if: $CI_MERGE_REQUEST_IID - if: $CI_COMMIT_TAG - if: $CI_COMMIT_BRANCH == "stable-3.0" 07070100000002000081A400000000000000000000000165BCF78700000066000000000000000000000000000000000000002400000000pdcom-3.0.11.0.gfcbffda/.gitmodules[submodule "doc/styles"] path = doc/styles url = https://gitlab.com/etherlab.org/doxygen-layout.git 07070100000003000081A400000000000000000000000165BCF78700000047000000000000000000000000000000000000002000000000pdcom-3.0.11.0.gfcbffda/AUTHORS $Id$ Richard Hacker <lerich@gmx.net> Florian Pose <fp@igh-essen.com> 07070100000004000081A400000000000000000000000165BCF7870000894B000000000000000000000000000000000000002000000000pdcom-3.0.11.0.gfcbffda/COPYING GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: <program> Copyright (C) <year> <name of author> This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>. 07070100000005000081A400000000000000000000000165BCF78700001DD5000000000000000000000000000000000000002700000000pdcom-3.0.11.0.gfcbffda/COPYING.LESSER GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. 07070100000006000081A400000000000000000000000165BCF78700003C85000000000000000000000000000000000000002200000000pdcom-3.0.11.0.gfcbffda/ChangeLog2017-04-25 Florian Pose <fp@gh.de> * src/msrproto/MsrChannel.cpp: Fixed readBase64Value(); remove abort condition; improved base64 size calc. [450a28b2270f] [tip] <stable-3.0> 2017-04-21 Florian Pose <fp@gh.de> * NEWS: NEWS. [c4349a5f96fa] <stable-3.0> 2017-04-21 Florian Pose <fp@igh-essen.com> * merge [e3b503097e12] <stable-3.0> 2016-09-01 Florian Pose <fp@igh-essen.com> * ChangeLog, NEWS, configure.ac: Release 3.0.8. [11fa6f72aaa1] <stable-3.0> 2017-04-21 Florian Pose <fp@gh.de> * src/msrproto/MsrChannel.cpp: Restored former base64 abort condition (newer one also buggy). [f1b7bda597fd] <stable-3.0> 2016-09-09 Florian Pose <fp@igh-essen.com> * src/msrproto/MsrChannel.cpp: Improved subscription interval error message. [649cb15b7b93] <stable-3.0> 2016-05-10 Florian Pose <fp@igh-essen.com> * src/msrproto/MsrChannel.cpp: Increased maximum block frequency to 25 Hz. [a259b4598164] <stable-3.0> * src/msrproto/MsrChannel.cpp: Fixed readBase64Value() abort condition. [3f103d8b76a6] <stable-3.0> 2015-12-05 Richard Hacker <lerichi@gmx.net> * src/msrproto/MsrChannel.cpp: Use index= instead of name= for <rk> [ce643c5bd942] <stable-3.0> 2015-11-07 Richard Hacker <lerichi@gmx.net> * src/msrproto/MsrChannel.cpp: Fixed a memory leak during poll() [c3919c8b074e] <stable-3.0> 2015-11-03 Richard Hacker <lerichi@gmx.net> * src/msrproto/MsrProtocolHandler.h: Fixed compiler warning: 'cdecl' attribute ignored [-Wattributes] [c52846aa91e0] <stable-3.0> * src/msrproto/MsrChannel.cpp: Fixed bug where timestamp of a MsrChannel value was incorrect [8b9149497907] <stable-3.0> 2015-05-20 Richard Hacker <lerichi@gmx.net> * src/Makefile.am: New automake issues [9095703bce97] <stable-3.0> 2014-10-21 hm <hm@picard> * src/msrproto/MsrProtocolHandler.cpp: removed forced expat encoding [d5487c32ecf4] <stable-3.0> 2014-02-25 Florian Pose <fp@igh-essen.com> * src/msrproto/MsrProtocolHandler.cpp, src/msrproto/MsrProtocolHandler.h: Process MSR broadcast tags. [6348d08108d9] <stable-3.0> 2014-02-19 Florian Pose <fp@igh-essen.com> * TODO: TODO. [f01d4e40a3d5] <stable-3.0> 2014-01-21 Richard Hacker <lerichi@gmx.net> * .hgignore: .hgignore [7200c5b72bf1] <stable-3.0> 2014-01-07 Florian Pose <fp@igh-essen.com> * src/Makefile.am: Changed AM_CPPFLAGS to AM_CXXFLAGS to enable -Wall. [f3d8efe84181] <stable-3.0> * m4/expat.m4, pdcom.spec.in: Removed some whitespace. [37d4f2d1b30d] <stable-3.0> 2013-05-24 Florian Pose <fp@igh-essen.com> * configure.ac: Release tasks. [3bbd522e782c] <stable-3.0> * NEWS, src/Data.cpp, src/Process.cpp, src/VariableConvert.cpp, src/msrproto/MsrChannel.cpp, src/msrproto/MsrParam.cpp: Avoided some warnings shown up using MinGW. [ed3ae804a98d] <stable-3.0> 2012-12-13 Florian Pose <fp@igh-essen.com> * configure.ac, m4/expat.m4: Added AM_PROG_AR necessary for autoconf 1.12. [6de5202b848f] <stable-3.0> 2012-02-22 Florian Pose <fp@igh-essen.com> * ChangeLog: Updated ChangeLog. [a68cd8288acc] <stable-3.0> * configure.ac: Version 3.0.7. [f84ce385f71d] <stable-3.0> * .hgignore, doc/Doxyfile.in, src/Data.cpp, src/DataDimension.cpp, src/Process.cpp, src/ProcessStreambuf.cpp, src/ProcessStreambuf.h, src/ProtocolHandler.cpp, src/ProtocolHandler.h, src/Time.cpp, src/Variable.cpp, src/VariableConvert.cpp, src/msrproto/MsrChannel.cpp, src/msrproto/MsrChannel.h, src/msrproto/MsrException.h, src/msrproto/MsrParam.cpp, src/msrproto/MsrParam.h, src/msrproto/MsrProtocolHandler.cpp, src/msrproto/MsrProtocolHandler.h, src/msrproto/MsrVariable.cpp, src/msrproto/MsrVariable.h, src/pdcom.h.in, src/pdcom/Data.h, src/pdcom/Exception.h, src/pdcom/Process.h, src/pdcom/RawData.h, src/pdcom/Subscriber.h, src/pdcom/Time.h, src/pdcom/Variable.h: Updated Doxyfile; updated documentation; removed extra whitespace. [b3092c27d1c3] <stable-3.0> 2012-02-21 Florian Pose <fp@igh-essen.com> * NEWS: NEWS. [89d4d6ba15b8] <stable-3.0> * example/ExampleProcess.cpp: Improved example. [caa7281396bf] <stable-3.0> * src/msrproto/MsrChannel.cpp, src/msrproto/MsrParam.cpp, src/msrproto/MsrVariable.cpp, src/msrproto/MsrVariable.h: Transpose: Fixed rnum/cnum; removed datawith; also transpose parameters. [2338efd4d2a0] <stable-3.0> * src/msrproto/MsrProtocolHandler.h: Minor: Removed whitespace. [0f82fdc262a5] <stable-3.0> * example/ExampleProcess.cpp, example/LinuxProcess.cpp: Minor: Removed whitespace in example. [830ef7187343] <stable-3.0> 2012-02-13 Florian Pose <fp@igh-essen.com> * src/msrproto/MsrChannel.cpp: Fixed MATRIX_COL_MAJOR transpose bug. [bb87d1bc9614] <stable-3.0> 2012-01-22 Florian Pose <fp@igh-essen.com> * src/msrproto/MsrParam.cpp: Minor: Spacing. [43ae779b27ce] <stable-3.0> * pdcom.spec.in: Summaries and descriptions. [c64e08e015de] <stable-3.0> 2012-01-21 Florian Pose <fp@igh-essen.com> * pdcom.spec.in: merge. [d6feb342c10c] <stable-3.0> * pdcom.spec.in: Fixed build dependency. [6eeb46e8f52a] <stable-3.0> * pdcom.spec.in: Improved spec file. [efc9fabe97de] <stable-3.0> * pdcom.spec.in: Improved spec file. [dc292d70d44b] <stable-3.0> 2011-07-15 Florian Pose <fp@igh-essen.com> * NEWS, configure.ac: Released version 3.0.6. [ac42c3f5deb8] <stable-3.0> 2011-07-11 Florian Pose <fp@igh-essen.com> * src/msrproto/MsrChannel.cpp: Fixed base64 debug output. [1c70b08b9b0f] <stable-3.0> * src/msrproto/MsrChannel.cpp: Polling for vector channels. [371069e66613] <stable-3.0> 2011-05-13 Florian Pose <fp@igh-essen.com> * ChangeLog, configure.ac: Released version 3.0.5. [1bab13114d1c] <stable-3.0> 2011-02-06 Richard Hacker <lerichi@gmx.net> * src/msrproto/MsrProtocolHandler.cpp: Fixed bug where pdcom crashes if Channel does not have an alias attribute [26ea80133823] <stable-3.0> 2010-10-12 Florian Pose <fp@igh-essen.com> * src/msrproto/MsrParam.cpp: Fixed reading vector parameters. [9ce05aded61e] <stable-3.0> 2010-05-12 Florian Pose <fp@igh-essen.com> * pdcom.spec.in: 64 bit support in spec file. [633af81300eb] <stable-3.0> 2010-04-20 Florian Pose <fp@igh-essen.com> * configure.ac: Released version 3.0.4. [4826164b6cab] <stable-3.0> 2010-01-18 Florian Pose <fp@igh-essen.com> * .hgignore: Switched to mercurial; Added .hgignore. [c7e5d7091e9c] <stable-3.0> 2010-01-12 Florian Pose <fp@igh-essen.com> * src/Data.cpp, src/ProcessStreambuf.cpp, src/pdcom/Variable.h: Fixed missing headers for GCC 4.4. [e2da23b2b5d9] <stable-3.0> 2009-12-18 Richard Hacker <ha@igh-essen.com> * ChangeLog, configure.ac: Released 3.0.3 [fd830afb9233] <stable-3.0> * src/Variable.cpp, src/msrproto/MsrParam.cpp, src/msrproto/MsrParam.h, src/pdcom/Variable.h: Added Variable::writeable and Variable::readable flags instead of using virtual classes [0094bb35e9c0] <stable-3.0> * src/Process.cpp, src/Variable.cpp, src/pdcom/Process.h: New flag process->readOnly [4d297c320f16] <stable-3.0> 2009-10-13 Florian Pose <fp@igh-essen.com> * pdcom.spec: Removed specfile again... [aed23690de27] <stable-3.0> * pdcom.spec: Added specfile. [feb383e70ca5] <stable-3.0> * configure.ac: Released version 3.0.2. [b6b5b3632446] <stable-3.0> * src/ProcessStreambuf.cpp: Slightly fix persistent problem with Streambouf not calling sendRequest(). [b52277d341a6] <stable-3.0> 2009-07-08 Florian Pose <fp@igh-essen.com> * src/pdcom/Data.h, src/pdcom/Exception.h, src/pdcom/RawData.h: Added missing documentation. [b1ac137c6379] <stable-3.0> * TODO, src/msrproto/MsrChannel.cpp, src/msrproto/MsrProtocolHandler.cpp: Replaced remaining atof() calls. [44e5a9d35ac3] <stable-3.0> * TODO: TODO. [31992bde3fb5] <stable-3.0> * src/msrproto/MsrProtocolHandler.cpp, src/pdcom/Variable.h: merge -c307 trunk: Small fixes needed to compile on x86-64 systems. [eaf3e73e85ab] <stable-3.0> * example/LinuxProcess.cpp, src/ProcessStreambuf.h, src/msrproto/MsrProtocolHandler.h: merge -c306 trunk: Updated #includes to work with newer gcc versions. [1f035f5149c7] <stable-3.0> * doc/Doxyfile.in: merge -c300 trunk: Fixed LaTeX output. [ad6bf8042e2c] <stable-3.0> * AUTHORS, COPYING.LESSER, Makefile.am, NEWS, README, TODO, bootstrap.sh, configure.ac, doc/Doxyfile.in, doc/Makefile.am, example/ExampleProcess.cpp, example/ExampleProcess.h, example/LinuxProcess.cpp, example/LinuxProcess.h, example/Makefile.am, example/main.cpp, pdcom.spec.in, src/Data.cpp, src/DataDimension.cpp, src/Makefile.am, src/Process.cpp, src/ProcessStreambuf.cpp, src/ProcessStreambuf.h, src/ProtocolHandler.cpp, src/ProtocolHandler.h, src/Time.cpp, src/Variable.cpp, src/VariableConvert.cpp, src/msrproto/Makefile.am, src/msrproto/MsrChannel.cpp, src/msrproto/MsrChannel.h, src/msrproto/MsrException.h, src/msrproto/MsrParam.cpp, src/msrproto/MsrParam.h, src/msrproto/MsrProtocolHandler.cpp, src/msrproto/MsrProtocolHandler.h, src/msrproto/MsrVariable.cpp, src/msrproto/MsrVariable.h, src/pdcom.h.in, src/pdcom/Data.h, src/pdcom/Exception.h, src/pdcom/Makefile.am, src/pdcom/Process.h, src/pdcom/RawData.h, src/pdcom/Subscriber.h, src/pdcom/Time.h, src/pdcom/Variable.h: LGPLv3 license headers. [6decba55bf62] <stable-3.0> * Ignore further m4 files. [1b1f9f68b3be] <stable-3.0> 2009-07-06 Florian Pose <fp@igh-essen.com> * TODO: TODO. [74c512f75994] <stable-3.0> * src/msrproto/MsrChannel.cpp, src/msrproto/MsrProtocolHandler.cpp: Added FIXMEs to atof() calls. [1d2cfd9b37ce] <stable-3.0> 2009-05-08 Florian Pose <fp@igh-essen.com> * TODO, example-ng/ExampleProcess.cpp, example-ng/ExampleProcess.h, example-ng/LinuxProcess.cpp, example-ng/LinuxProcess.h, example- ng/Makefile.am, example-ng/main.cpp: Removed example-ng. [688549fb7560] <stable-3.0> * m4/libtool.m4, m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4: Removed some m4 files again. [aa4b312b7ecd] <stable-3.0> * COPYING, INSTALL, m4/libtool.m4, m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4: Added m4 files and INSTALL and COPYING files. [311b0941a091] <stable-3.0> * Makefile.am: Fixed ACLOCAL_AMFLAGS. [13606557c227] <stable-3.0> 2009-01-13 Florian Pose <fp@igh-essen.com> * src/msrproto/MsrParam.cpp: Fixed floating point parsing on non-english environments... [28b3b347eb43] <stable-3.0> 2009-01-09 Florian Pose <fp@igh-essen.com> * src/msrproto/MsrChannel.cpp, src/msrproto/MsrChannel.h: Fixed use of the time attribute in msr's data tag. [1eeedbb50f58] <stable-3.0> * src/msrproto/MsrChannel.cpp, src/msrproto/MsrProtocolHandler.cpp: Bugfix: Locale-independent parsing of MSR's time attribute. [780a3ec31eb4] <stable-3.0> * src/Time.cpp: Minor changes. [4a14a1e6df67] <stable-3.0> 2009-01-08 Florian Pose <fp@igh-essen.com> * src/Process.cpp: Removed unnecessary define. [e77dfb8cbe61] <stable-3.0> 2008-12-04 Richard Hacker <ha@igh-essen.com> * configure.ac, src/Variable.cpp, src/msrproto/MsrChannel.cpp, src/msrproto/MsrParam.cpp, src/msrproto/MsrParam.h, src/pdcom/Variable.h: Fixed bug where poll() did not set the value of the variable [1418d31f0535] <stable-3.0> 2008-11-28 Florian Pose <fp@igh-essen.com> * src/pdcom/Data.h, src/pdcom/Exception.h, src/pdcom/Process.h, src/pdcom/RawData.h, src/pdcom/Subscriber.h, src/pdcom/Time.h, src/pdcom/Variable.h: Prefixed duplicate-inclusion-protection with PDCOM_ to avoid conflicts with other headers. [12478490e2b1] <stable-3.0> 2008-11-21 Florian Pose <fp@igh-essen.com> * Makefile.am: Fixed spec. [8eff690bab34] <stable-3.0> * Makefile.am, configure.ac, pdcom.spec.in: Version 3.0.0 with Spec-File. [4794200124be] <stable-3.0> * example/Makefile.am: Added headers to dist. [63929726cd09] <stable-3.0> * example/LinuxProcess.cpp, src/ProcessStreambuf.cpp, src/msrproto/MsrChannel.cpp, src/msrproto/MsrProtocolHandler.cpp: Added missing headers. [51d3b84b5e06] <stable-3.0> 2008-11-20 Florian Pose <fp@igh-essen.com> * src/Process.cpp, src/pdcom/Process.h: Made VariableList a VariableSet, because otherwise Process::reset() takes ~10 s for removing 9000 variables. [759774d472e3] <stable-3.0> * src/Makefile.am: Removed dependency to /opt/etherlab/rtw. [cd47e531c22c] <stable-3.0> * src/pdcom/Process.h: Added missing implementation for getVariableList(). [340425736277] <stable-3.0> * Makefile.am, configure.ac, src/Makefile.am, src/Process.cpp, src/rtcomproto/Makefile.am, src/rtcomproto/Process.cpp, src/rtcomproto/Process.h, src/rtcomproto/ProcessLayer.cpp, src/rtcomproto/ProcessLayer.h, src/rtcomproto/ProtocolHandler.cpp, src/rtcomproto/ProtocolHandler.h, src/rtcomproto/Variable.cpp, src/rtcomproto/Variable.h: Removed RTCom protocol for 3.0 release. [803320bfb546] <stable-3.0> * Makefile.am, TODO, configure.ac, m4/ac_pkg_swig.m4, m4/ac_python_devel.m4, m4/event.m4, m4/sasl.m4, m4/swig_enable_cxx.m4, m4/swig_python.m4, pyext/Makefile.am, pyext/PyCProcess.cpp, pyext/PyCProcess.h, pyext/Pythoncode.py, pyext/README, pyext/pyexample.py, pyext/rtcom.i: Removed python extention for 3.0 [71952d749257] <stable-3.0> 2008-09-02 Florian Pose <fp@igh-essen.com> * src/Makefile.am: Added EXPAT_LIBS and EXPAT_LDFLAGS. [af5803ee6546] <stable-3.0> * src/Makefile.am, src/Process.cpp, src/msrproto/Channel.cpp, src/msrproto/Channel.h, src/msrproto/Exception.h, src/msrproto/Makefile.am, src/msrproto/MsrChannel.cpp, src/msrproto/MsrChannel.h, src/msrproto/MsrException.h, src/msrproto/MsrParam.cpp, src/msrproto/MsrParam.h, src/msrproto/MsrProtocolHandler.cpp, src/msrproto/MsrProtocolHandler.h, src/msrproto/MsrVariable.cpp, src/msrproto/MsrVariable.h, src/msrproto/Param.cpp, src/msrproto/Param.h, src/msrproto/ProtocolHandler.cpp, src/msrproto/ProtocolHandler.h, src/msrproto/Variable.cpp, src/msrproto/Variable.h: Don not create shared library for Msr protocol handler, but link it directly to avoid problems with DLLs under windows. [011d032d98e4] <stable-3.0> * example/Makefile.am: Added missing -lexpat. [cd0a578d5e42] <stable-3.0> * configure.ac: Commented out libsasl and libevent dependencies. [5dac7e4e599e] <stable-3.0> * src/Makefile.am: Added missing EXPAT_CPPFLAGS. [39b41de9c6bf] <stable-3.0> 2008-08-28 Florian Pose <fp@igh-essen.com> * src/ProcessStreambuf.cpp, src/ProcessStreambuf.h, src/msrproto/Param.cpp: Introduced flush() method for ProcessStreambuf to assure, that sendRequest() is called. [e03a11f39cbe] <stable-3.0> 2008-08-27 Florian Pose <fp@igh-essen.com> * src/ProcessStreambuf.cpp: Fixed debugging for ProcessStreambuf. [c35a2af34f4a] <stable-3.0> * src/msrproto/Param.cpp: Added debugging for Msr Parameters. [b49ed144d64e] <stable-3.0> * src/Variable.cpp, src/VariableConvert.cpp, src/pdcom/Variable.h: Fixed bug concerning data conversions: Introduced read_noscale and write_noscale conversion matrices. [f8ce99105e5c] <stable-3.0> 2008-08-25 Florian Pose <fp@igh-essen.com> * src/Process.cpp: merge -c266 trunk: ProtocolLog when variable not found. [36704381cb4c] <stable-3.0> 2008-08-12 Florian Pose <fp@igh-essen.com> * README, TODO, doc/Doxyfile.in, doc/Makefile.am, example/ExampleProcess.h, src/DataDimension.cpp, src/pdcom/Data.h, src/pdcom/Variable.h: merge -r259:261 trunk: Doc. [b9f48bb198ff] <stable-3.0> * configure.ac: Version 3.0.0-pre. [9d74d3a89b49] <stable-3.0> * Created branch stable-3.0. [3bba577d178a] <stable-3.0> 07070100000007000081A400000000000000000000000165BCF78700002528000000000000000000000000000000000000002000000000pdcom-3.0.11.0.gfcbffda/INSTALLInstallation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 6. Often, you can also type `make uninstall' to remove the installed files again. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. 07070100000008000081A400000000000000000000000165BCF787000004BC000000000000000000000000000000000000002400000000pdcom-3.0.11.0.gfcbffda/Makefile.am#----------------------------------------------------------------------------- # # $Id$ # # Copyright (C) 2009 Richard Hacker <lerich@gmx.net> # Florian Pose <fp@igh-essen.com> # # This file is part of the PdCom library. # # The PdCom library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # The PdCom library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. # #----------------------------------------------------------------------------- ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src doc if ENABLE_EXAMPLE SUBDIRS += example endif EXTRA_DIST = \ pdcom.spec \ pdcom.spec.in #----------------------------------------------------------------------------- 07070100000009000081A400000000000000000000000165BCF787000006B1000000000000000000000000000000000000001D00000000pdcom-3.0.11.0.gfcbffda/NEWS Since 3.0.11: - Changes in build system, documentation and CI pipeline. Since 3.0.10: - Fixed TLINT and TULINT types to be 64-bit. Since 3.0.9: - Install to /usr/local by default. Version 3.0.9: - Fixed Base64 decoding bug introduced in 3.0.8. Version 3.0.8: - Added AM_PROG_AR necessary for autoconf 1.12. - Avoided warnings shown up using MinGW. - Process MSR broadcast tags. - Fixed bugs and memory leaks. - Increased maximum block frequency to 25 Hz. Version 3.0.7: - Improved spec file. - Fixed transposing MATRIX_COL_MAJOR variables. Version 3.0.6: - Fixed base64 debug output. - Fixed polling for vector channels. Version 3.0.5: - Fixed bug where pdcom crashes if Channel does not have an alias attribute. - Fixed reading vector parameters. - 64 bit support in spec file. Version 3.0.4. - Switched to mercurial. - Fixed missing headers for GCC 4.4. Version 3.0.3 - readOnly flag for Process. - Added RPM specfile. Version 3.0.2 - Added LGPLv3 license headers. - Bugfix: Locale-independent parsing of MSR's time attributes. - Bugfix: The time attribute in MSR's <data> tag is now treated as the time of the last data values. Version 3.0.1 (2008-12-04) - Bugfixes. Version 3.0.0 (2008-01-04) - Brand new revamped interface! - The subscription interface has changed. Previously it was necessary to ask a Process Variable for a Subscription. Now the Subscription is instatiated completely separately from a Process Variable. As a second step, a Subscription is attached to a Variable. - Apart from that, it is now also possible to declare a Subscription with a negative sample time. This indicates a polled subscription. Calling Subscription::poll() will initiate a poll. 0707010000000A000081A400000000000000000000000165BCF78700000399000000000000000000000000000000000000001F00000000pdcom-3.0.11.0.gfcbffda/README $Id$ This is the README file of the PdCom library, that is part of the EtherLab project (http://etherlab.org/en). The home of PdCom is http://etherlab.org/en/pdcom. The Library is released under the terms and conditions of the GNU Lesser General Public License (LGPL), version 3 or (at your option) any later version. *** Documentation *** The library documentation resides in the header files and can be brought to HTML, LaTeX and man format with the doxygen tool. To generate the documentation, make sure that doxygen is installed and then call: ./configure make -C doc dox Then point your favourite browser to doc/html/index.html. *** Building and Installing *** To just build and install the library, call: ./configure make make install ** Further Information *** For questions of any kind, subscribe to the etherlab-users mailing list at http://etherlab.org/en. Have fun with PdCom! 0707010000000B000081A400000000000000000000000165BCF7870000006B000000000000000000000000000000000000001D00000000pdcom-3.0.11.0.gfcbffda/TODO $Id$ vim: spelllang=en spell ‣ Remove const on Process::processMessage() and Process::protocolLog(). 0707010000000C000081ED00000000000000000000000165BCF7870000046B000000000000000000000000000000000000002500000000pdcom-3.0.11.0.gfcbffda/bootstrap.sh#!/bin/bash #------------------------------------------------------------------------------ # # $Id$ # # Copyright (C) 2009 Richard Hacker <lerich@gmx.net> # Florian Pose <fp@igh-essen.com> # # This file is part of the PdCom library. # # The PdCom library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # The PdCom library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. # #------------------------------------------------------------------------------ set -x mkdir -p autoconf autoreconf -i #------------------------------------------------------------------------------ 0707010000000D000081A400000000000000000000000165BCF78700000E28000000000000000000000000000000000000002500000000pdcom-3.0.11.0.gfcbffda/configure.ac#----------------------------------------------------------------------------- # # Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> # - 2024 Florian Pose <fp@igh.de> # # This file is part of the PdCom library. # # The PdCom library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # The PdCom library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. # # -*- Autoconf -*- # #----------------------------------------------------------------------------- # # Release tasks: # - Update version in AC_INIT() # - Update library version in LT_VERSION_INFO # - Update NEWS file # - Update ChangeLog (hg log --style changelog -b stable-3.0 > ChangeLog) # AC_PREREQ(2.59) AC_INIT([pdcom], [3.0.11], [fp@igh.de]) AC_CONFIG_AUX_DIR(autoconf) AM_INIT_AUTOMAKE([-Wall -Werror]) AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) # Fetch major, minor and revision numbers from $VERSION set ${VERSION//./ } if test "x$VERSION" == "xdevel"; then DEVEL=1 else DEVEL=0 fi AC_SUBST([PDCOM_MAJOR],$(($1+0))) AC_SUBST([PDCOM_MINOR],$(($2+0))) AC_SUBST([PDCOM_RELEASE],$(($3+0))) AC_SUBST(DEVEL) # http://www.gnu.org/software/libtool/manual/html_node/ ... # Updating-version-info.html LT_VERSION_INFO="-version-info 4:2:3" AC_SUBST(LT_VERSION_INFO) # Checks for programs AC_PROG_CXX m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LIBTOOL PKG_CHECK_MODULES([EXPAT], [expat >= 2]) AC_ARG_WITH([etherlab-dir], AS_HELP_STRING( [--with-etherlab-dir=<etherlab-dir>], [Directory where EtherLab is installed]), [ etherlab_dir=${withval} ], [ etherlab_dir="/opt/etherlab" ] ) AC_SUBST(ETHERLAB_DIR,[$etherlab_dir]) AC_ARG_ENABLE(example, AS_HELP_STRING([--disable-example], [Example executable generation]), [ case "${enableval}" in yes) example=1 ;; no) example=0 ;; *) AC_MSG_ERROR([Invalid value for --enable-example]) ;; esac ], [example=1] ) AM_CONDITIONAL(ENABLE_EXAMPLE, test "x$example" = "x1") # Checks for header files AC_HEADER_STDC AC_CHECK_HEADERS([stddef.h stdint.h sys/param.h sys/time.h unistd.h], [], [AC_MSG_ERROR([Required header file does not exist])]) # Checks for typedefs, structures and compiler characteristics AC_HEADER_STDBOOL AC_C_CONST AC_HEADER_TIME AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT64_T AC_TYPE_INT8_T AC_TYPE_SIZE_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T # Checks for library functions. AC_CHECK_FUNCS([memmove memset strchr], [], [AC_MSG_ERROR([Required library function does not exist])] ) AC_CHECK_FUNCS([gethostname]) AC_FUNC_STRTOD # Output files AC_CONFIG_FILES([ Makefile doc/Doxyfile doc/Makefile example/Makefile pdcom.spec src/Makefile src/msrproto/Makefile src/pdcom.h src/pdcom/Makefile ]) AC_OUTPUT #----------------------------------------------------------------------------- 0707010000000E000041ED00000000000000000000000365BCF78700000000000000000000000000000000000000000000001C00000000pdcom-3.0.11.0.gfcbffda/doc0707010000000F000081A400000000000000000000000165BCF7870000C1D4000000000000000000000000000000000000002800000000pdcom-3.0.11.0.gfcbffda/doc/Doxyfile.in# Doxyfile 1.5.0 # #--------------------------------------------------------------------------- # # Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> # Florian Pose <fp@igh-essen.com> # # This file is part of the PdCom library. # # The PdCom library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # The PdCom library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. # #--------------------------------------------------------------------------- # # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = @PACKAGE@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @PACKAGE_VERSION@ PROJECT_LOGO = @abs_srcdir@/styles/images/igh+logo.svg # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, # Italian, Japanese, Japanese-en (Japanese with English messages), Korean, # Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, # Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to # include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from the # version control system). Doxygen will invoke the program by executing (via # popen()) the command <command> <input-file>, where <command> is the value of # the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = YES # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @abs_top_builddir@/src/pdcom.h @abs_top_srcdir@/src/pdcom/ # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = ../example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command <filter> <input-file>, where <filter> # is the value of the INPUT_FILTER tag, and <input-file> is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentstion. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = @abs_srcdir@/styles/style/html_header.html # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = @abs_srcdir@/styles/style/html_footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = HTML_EXTRA_STYLESHEET = @abs_srcdir@/styles/style/custom.css \ @abs_srcdir@/styles/style/custom_igh_theme.css # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = YES # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = yes # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a caller dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected # functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that a graph may be further truncated if the graph's # image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH # and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), # the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO 07070100000010000081A400000000000000000000000165BCF7870000047F000000000000000000000000000000000000002800000000pdcom-3.0.11.0.gfcbffda/doc/Makefile.am#----------------------------------------------------------------------------- # # $Id$ # # Copyright (C) 2009 Richard Hacker <lerich@gmx.net> # Florian Pose <fp@igh-essen.com> # # This file is part of the PdCom library. # # The PdCom library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # The PdCom library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. # #----------------------------------------------------------------------------- EXTRA_DIST = Doxyfile.in dox: doxygen Doxyfile BUILT_SOURCES = Doxyfile #----------------------------------------------------------------------------- 07070100000011000041ED00000000000000000000000465BCF78700000000000000000000000000000000000000000000002300000000pdcom-3.0.11.0.gfcbffda/doc/styles07070100000012000041ED00000000000000000000000265BCF78700000000000000000000000000000000000000000000002A00000000pdcom-3.0.11.0.gfcbffda/doc/styles/images07070100000013000081A400000000000000000000000165BCF7870000204B000000000000000000000000000000000000003700000000pdcom-3.0.11.0.gfcbffda/doc/styles/images/igh+logo.svg<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="270.61478" height="109.32083" viewBox="0 0 202.96108 81.990625" version="1.1" id="svg1445" sodipodi:docname="igh+logo.svg" inkscape:export-filename="/home/jonathan/Dokumente/LINUX/übungen/doxygen_Ãœbung/hg-doxygen/doc/images/igh+logo.png" inkscape:export-xdpi="96" inkscape:export-ydpi="96" inkscape:version="1.0.2 (e86c870879, 2021-01-15)"> <metadata id="metadata1451"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> <defs id="defs1449" /> <sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1920" inkscape:window-height="1016" id="namedview1447" showgrid="false" fit-margin-top="5" fit-margin-left="10" fit-margin-right="5" fit-margin-bottom="10" inkscape:zoom="3.0985401" inkscape:cx="105.66561" inkscape:cy="78.045266" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="surface1" units="px" /> <g id="surface1" transform="translate(34.257957,1.2757817)"> <path style="fill:none;stroke:#d20a00;stroke-width:19.8425;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1" d="M -267.57957,184.25781 H -51.25 m 907.07031,0 H 1195.9766 M 1054.2578,42.539062 1224.3359,722.85156 M 1082.6172,581.09375 h 566.9141" id="path1432" sodipodi:nodetypes="cccccccc" transform="matrix(0.1,0,0,-0.1,0,75)" /> <path style="fill:none;stroke:#000000;stroke-width:7.08661;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1" d="m 1111.9922,478.04687 c -34.0625,-9.72656 -60.3516,-36.91406 -68.9453,-71.28906 -13.2813,-53.16406 19.0234,-107.03125 72.1875,-120.3125 53.164,-13.32031 107.0312,19.02344 120.3125,72.1875 8.5937,34.375 -1.7969,70.74219 -27.3047,95.35156" id="path1434" transform="matrix(0.1,0,0,-0.1,0,75)" /> <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 120.82422,29.601562 5.5625,5.226563 -5.14063,2.394531 -0.42187,-7.621094" id="path1436" /> <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 1.851562,56.398438 c 1.480469,-0.179688 2.574219,-0.546876 3.28125,-1.09375 0.710938,-0.546876 1.296876,-1.671876 1.761719,-3.371094 l 7.628907,-27.925782 c 0.222656,-0.789062 0.382812,-1.449218 0.484374,-1.976562 0.121094,-0.546875 0.183594,-1.019531 0.183594,-1.425781 0,-1.054688 -0.292968,-1.710938 -0.882812,-1.976563 -0.585938,-0.28125 -1.8125,-0.503906 -3.675782,-0.667968 v -1.609376 h 18.507813 v 1.609376 c -1.519531,0.203124 -2.625,0.566406 -3.3125,1.09375 -0.667969,0.527343 -1.238281,1.652343 -1.703125,3.375 l -7.65625,27.921874 -0.488281,2.160157 c -0.03906,0.203125 -0.08203,0.414062 -0.121094,0.636719 -0.01953,0.203124 -0.03125,0.394531 -0.03125,0.578124 0,1.054688 0.285156,1.722657 0.851563,2.003907 0.566406,0.285156 1.792968,0.507812 3.675781,0.667969 v 1.582031 H 1.851562 v -1.582031" id="path1438" /> <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 32.167969,56.445312 c 5.929687,0 6.746093,-0.601562 7.394531,-1.171874 0.667969,-0.566407 1.234375,-1.679688 1.699219,-3.339844 l 7.660156,-27.925782 c 0.160156,-0.648437 0.300781,-1.273437 0.421875,-1.882812 0.144531,-0.609375 0.214844,-1.113281 0.214844,-1.519531 0,-1.054688 -0.285156,-1.710938 -0.851563,-1.976563 C 48.140625,18.347656 46.914062,18.125 45.03125,17.960938 V 16.351562 H 64.75 v 1.609376 c -2.167969,0.222656 -3.625,0.566406 -4.375,1.035156 -0.75,0.445312 -1.378906,1.589844 -1.882812,3.433594 l -3.402344,12.367187 h 14.855468 l 2.949219,-10.789063 c 0.183594,-0.707031 0.335938,-1.347656 0.457031,-1.914062 0.121094,-0.585938 0.179688,-1.082031 0.179688,-1.488281 0,-1.09375 -0.402344,-1.8125 -1.214844,-2.15625 -0.527344,-0.222657 -1.628906,-0.386719 -3.3125,-0.488281 v -1.609376 h 18.507813 v 1.609376 c -1.441407,0.183593 -2.441407,0.464843 -3.007813,0.851562 -0.875,0.628906 -1.550781,1.832031 -2.039062,3.617188 l -7.625,27.921874 -0.515625,2.160157 c -0.101563,0.464843 -0.164063,0.757812 -0.183594,0.878906 -0.01953,0.101563 -0.03125,0.234375 -0.03125,0.394531 0,1.074219 0.457031,1.792969 1.367187,2.160156 0.546876,0.222657 1.632813,0.375 3.253907,0.453126 v 1.582031 H 58.976562 v -1.582031 c 2.167969,-0.222657 3.625,-0.554688 4.375,-1 0.769532,-0.46875 1.410157,-1.621094 1.917969,-3.464844 L 69.21875,37.53125 H 54.390625 l -3.527344,12.820312 c -0.242187,0.953126 -0.402343,1.632813 -0.484375,2.035157 -0.08203,0.40625 -0.121094,0.902343 -0.121094,1.492187 0,0.992188 0.273438,1.621094 0.820313,1.882813 0.546875,0.261719 1.769531,0.476562 3.675781,0.636719 v 1.582031 H 36.21875 l -4.050781,-1.535157" id="path1440" /> <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 32.964844,64.429688 c -0.589844,-0.566407 -1.398438,-1.0625 -2.429688,-1.488282 -0.710937,-0.28125 -1.855468,-0.6875 -3.433594,-1.214844 -1.5625,-0.507812 -2.492187,-0.757812 -2.796874,-0.757812 0,-0.304688 -0.8125,0.128906 -2.429688,1.304688 -1.621094,1.175781 -2.433594,2.542968 -2.433594,4.101562 0,0.972656 0.375,1.863281 1.125,2.675781 1.234375,1.375 3.28125,2.066407 6.136719,2.066407 2.25,0 4.003906,-0.40625 5.257813,-1.214844 C 33.238281,69.089844 33.875,68.046875 33.875,66.769531 33.875,65.777344 33.570312,65 32.964844,64.429688 Z m 1.03125,-19.324219 c 1.277344,-2.652344 1.914062,-5.183594 1.914062,-7.59375 0,-1.097657 -0.222656,-1.996094 -0.667968,-2.707031 -0.445313,-0.707032 -1.175782,-1.0625 -2.1875,-1.0625 -1.925782,0 -3.472657,1.417968 -4.648438,4.253906 -1.15625,2.835937 -1.730469,5.367187 -1.730469,7.597656 0,1.132812 0.261719,1.996094 0.789063,2.582031 0.527344,0.585938 1.195312,0.878907 2.003906,0.878907 1.761719,0 3.273438,-1.3125 4.527344,-3.949219 z M 19.867188,58.902344 c -0.933594,-0.769532 -1.398438,-1.792969 -1.398438,-3.070313 0,-1.03125 0.425781,-1.964843 1.277344,-2.796875 C 20.597656,52.1875 22.15625,51.152344 24.425781,49.9375 22.742188,49.328125 21.5,48.410156 20.6875,47.171875 19.878906,45.9375 19.472656,44.449219 19.472656,42.707031 c 0,-2.613281 1.226563,-5.085937 3.675782,-7.414062 2.453124,-2.332031 5.683593,-3.496094 9.695312,-3.496094 2.085938,0 3.910156,0.335937 5.46875,1.003906 1.578125,0.667969 2.195312,1.183594 2.910156,1.976563 h 5.835938 v 2.746094 h -4.171875 c 0.121093,0.527343 0.195312,0.785156 0.257812,1.171874 0.05859,0.386719 0.08984,0.820313 0.08984,1.304688 0,3 -1.183594,5.574219 -3.554687,7.71875 -2.351563,2.128906 -5.664063,3.191406 -9.9375,3.191406 -0.929688,0 -2.046876,-0.109375 -3.339844,-0.335937 -0.328125,0 -0.671875,0.253906 -1.035156,0.761719 -0.34375,0.507812 -0.515626,0.941406 -0.515626,1.304687 0,0.667969 0.496094,1.269531 1.488282,1.792969 0.464844,0.265625 1.03125,0.496094 1.703125,0.699218 l 3.3125,0.941407 c 2.894531,0.832031 4.949219,1.640625 6.167969,2.433593 2.085937,1.335938 3.128906,3.179688 3.128906,5.527344 0,2.632813 -1.390625,4.824219 -4.164063,6.566406 -2.773437,1.738282 -6.21875,2.609376 -10.332031,2.613282 -2.695312,0 -5.03125,-0.328125 -7.019531,-0.972656 -3.421875,-1.09375 -5.132813,-3.019532 -5.132813,-5.773438 0,-1.785156 0.910156,-3.234375 2.734375,-4.347656 1.011719,-0.605469 2.804688,-1.285156 5.378907,-2.035156 -1.015626,-0.363282 -1.761719,-0.757813 -2.25,-1.183594" id="path1442" /> </g> </svg> 07070100000014000041ED00000000000000000000000265BCF78700000000000000000000000000000000000000000000002900000000pdcom-3.0.11.0.gfcbffda/doc/styles/style07070100000015000081A400000000000000000000000165BCF78700001AEA000000000000000000000000000000000000003400000000pdcom-3.0.11.0.gfcbffda/doc/styles/style/custom.css/*********************************************/ /** TOP MENU **/ /*********************************************/ div.fragment, pre.fragment { margin: 0; padding: 4px; border: 1px solid #a4a4a4; background: #cecece; } /*********************************************/ /** Main content **/ /*********************************************/ div.contents, div.headertitle { margin: 10px 10px !important; padding: 0 10px; max-width: 60em; text-align: justify; } div.title { font-size: 200%; } div.directory { margin: 10px 0px; border-top: 1px solid #32363D; border-bottom: 1px solid #32363D; width: 100%; } /*********************************************/ /** Inline code **/ /*********************************************/ p code, li code, td code, dd code { display: inline; padding: 0px 6px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; background-color: #CCCCCC; border: 1px solid #333333; color: #333333; } /*********************************************/ /** Table of Contents (ToC) **/ /*********************************************/ div.toc { margin: 0 !important; border-radius: 4px !important; } div.toc h3 { font-size: 150%; color: inherit; } /*********************************************/ /** Content table **/ /*********************************************/ .contents table.doxtable { margin: 0 auto; } /*********************************************/ /** Field table **/ /*********************************************/ .fieldtable { box-shadow: none !important; -webkit-box-shadow: none; -moz-box-shadow: none; } /*********************************************/ /** Memitem and memtitle **/ /*********************************************/ .memitem, .memproto, .memdoc { box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none; background-image: none; } /*********************************************/ /** TOP navigation **/ /*********************************************/ .tablist a:hover, .tablist li.current a { text-shadow: none; -moz-text-shadow: none; -webkit-text-shadow: none; } /*********************************************/ /** H1 in textblocks **/ /*********************************************/ .textblock h1 { margin: 40px 0px 10px 0px; padding-bottom: 10px; padding-top: 10px; padding-left: 5px; } .textblock h1:first-child { margin-top: 10px; } /*********************************************/ /** Note, warning **/ /*********************************************/ dl.note, dl.warning, dl.todo, dl.deprecated, dl.reflist { border: 0; padding: 0px; margin: 4px 0px 4px 0px; border-radius: 4px; } dl.note dt, dl.warning dt, dl.todo dt, dl.deprecated dt, dl.reflist dt { margin: 0; font-size: 14px; padding: 2px 4px; border: none; border-top-left-radius: 0px; border-top-right-radius:0px; font-weight: bold; text-transform: uppercase; color: #FFFFFF !important; box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none; text-shadow: none; } dl.note dd, dl.warning dd, dl.todo dd, dl.deprecated dd, dl.reflist dd { margin: 0; padding: 4px; background: none; color: #222222; border: 1px solid; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top: none; box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none; text-shadow: none; } dl.reflist dd { margin-bottom: 15px; } /* Background colors */ dl.note {} dl.warning {} dl.todo {} dl.deprecated {} dl.reflist {} /* Header */ dl.note dt { background-color: #cbc693; } dl.warning dt { background-color: #bf5f82; } dl.todo dt { background-color: #82b3c9; } dl.deprecated dt { background-color: #af8eb5; } dl.reflist dt { background-color: #cbae82; } /* Content */ dl.note dd { background-color: #fff9c4; border-color: #cbc693; } dl.warning dd { background-color: #f48fb1; border-color: #bf5f82; } dl.todo dd { background-color: #b3e5fc; border-color: #82b3c9; } dl.deprecated dd { background-color: #e1bee7; border-color: #af8eb5; } dl.reflist dd { background-color: #ffe0b2; border-color: #cbae82; } /*********************************************/ /** Reference list **/ /**Similar to warning/note/todo/... messages**/ /*********************************************/ dl.reflist { } /*********************************************/ /** Note, warning **/ /*********************************************/ #docs_list { padding: 0 10px; } #docs_list ul { margin: 0; padding: 0; list-style: none; } #docs_list ul li { display: inline-block; border-right: 1px solid #BFBFBF; } #docs_list ul li:last-child { border-right: none; } #docs_list ul li a { display: block; padding: 8px 13px; font-weight: bold; font-size: 15px; } #docs_list ul li a:hover, #docs_list ul li a.docs_current { text-decoration: underline; } /*********************************************/ /** Resizable UI **/ /*********************************************/ .ui-resizable-e { width: 3px; } /*********************************************/ /** Download url **/ /*********************************************/ .download_url { font-weight: bold; font-size: 150%; line-height: 150%; } /*********************************************/ /** Syntax folor **/ /*********************************************/ div.line a { text-decoration: underline; } span.lineno a { text-decoration: none; } /*********************************************/ /** Modules/Directory table **/ /*********************************************/ .directory .arrow { height: initial; } .directory td.entry { padding: 3px 6px; } /*********************************************/ /** Mem items **/ /*********************************************/ .memproto table td { font-family: monospace, fixed !important; } td.memItemLeft, td.memItemRight { font-family: monospace, fixed; } .paramname, .paramname em { font-style: italic; } .memdoc { text-shadow: none; } .memItem { font-family: monospace, fixed; } .memItem table { font-family: inherit; } /*********************************************/ /** Footer **/ /*********************************************/ img.footer { height: 22px; } /*********************************************/ /** Custom scrollbar **/ /*********************************************/ /*********************************************/ /** Custom scrollbar **/ /*********************************************/ 07070100000016000081A400000000000000000000000165BCF78700001FAF000000000000000000000000000000000000003E00000000pdcom-3.0.11.0.gfcbffda/doc/styles/style/custom_igh_theme.css/* TOP MENU */ .sm-dox { background: #dfe5f2 !important; } .sm-dox a { background: none; } body { background: #fff; background-image: none; color: #343637; /* Color of Text */ } a, a:link, a:visited { color: #d20a00 !important; } .highlighted { background: none !important; } a.highlighted { background: none !important; } /*********************************************/ /** Top main menu **/ /*********************************************/ #main-nav { /* display: none; */ border-bottom: 1px solid #32363d; } #main-nav .sm-dox { background: #cecece !important; } .sm-dox a { text-shadow: none !important; background: #cecece !important; } .sm-dox a:hover { background: #a1a1a2 !important; } .sm-dox { text-shadow: none !important; box-shadow: none !important; } .sm-dox ul { border: 1px solid #e6e9eb; background: #e6e9eb; } table.directory { background: #eaeaea; } .directory tr.even { background: #ccc; } /*********************************************/ /** Top search **/ /*********************************************/ #MSearchSelectWindow { border: 1px solid #757575; background: #cecece; } a.selectItem { padding: 3px; } a.SelectItem:hover { background: #282923 !important; } #MSearchResultsWindow { border: 1px solid #757575; background: #cecece; color: #d12820 !important; } /*********************************************/ /** Main menu **/ /*********************************************/ #nav-tree { background: transparent; } #nav-tree .selected { background-image: none; background: #32363d; } #titlearea { padding: 0px; margin: 0px; width: 100%; border-bottom: 1px solid #d20a00; } /*********************************************/ /** Main content **/ /*********************************************/ /*********************************************/ /** Inline code **/ /*********************************************/ p code, li code, td code, dd code { background-color: #c6c6c6; border: 1px solid #E3CACA; color: #D3180F; /* background-color: #000000; border: 1px solid #A8B8D9; color: #D8D8D8; */ } /*********************************************/ /** Table of Contents (ToC) **/ /*********************************************/ div.toc { background: #32363d; border: 1px solid #000000; } div.toc h3 { font-size: 150%; color: inherit; } /*********************************************/ /** Content table **/ /*********************************************/ table.doxtable tr:nth-child(even) td { background: #32363d; } div.header { background: transparent; border-bottom: 1px solid #e6e9eb; } /*********************************************/ /** Field table **/ /*********************************************/ .fieldtable th { background: #282923; color: inherit; } /*********************************************/ /** Memitem and memtitle **/ /*********************************************/ .memdoc { border: 1px solid #A8B8D9; } /*********************************************/ /** TOP navigation **/ /*********************************************/ .tabs, .tabs2, .tabs3 { background: #DDDDDD; } .tablist li { background: transparent !important; } .tablist a { background-image: none; border-right: 1px solid #999999; color: #32363d; } .tablist a:hover, .tablist li.current a { text-decoration: none; color: #000000; background: #CCCCCC; background-image: none; } /*********************************************/ /** H1 in textblocks **/ /*********************************************/ /*********************************************/ /** Note, warning **/ /*********************************************/ /*********************************************/ /** Reference list **/ /**Similar to warning/note/todo/... messages**/ /*********************************************/ dl.reflist { } /*********************************************/ /** Note, warning **/ /*********************************************/ #docs_list { background: #32363d; } #docs_list ul li { border-right: 1px solid #BFBFBF; } #docs_list ul li a { color: #1b1e21; } #docs_list ul li a:hover, #docs_list ul li a.docs_current { background: #282923; } /*********************************************/ /** Resizable UI **/ /*********************************************/ .ui-resizable-e { background: #32363d; } /*********************************************/ /** Download url **/ /*********************************************/ /*********************************************/ /** Syntax folor **/ /*********************************************/ div.line { background: transparent; color: #343637; } div.line a { color: inherit; } span.keyword { color: #ea4d00; font-style: normal; font-weight: 600; } span.keywordtype { color: #009984;; font-style: normal; font-weight: 600; } span.keywordflow { color: #8109c4;; font-style: normal; font-weight: 600; } span.comment { color: #74705a; } span.preprocessor { color: #8109c4; } span.stringliteral { color: #076604;; } span.charliteral { color: #076604;; } span.vhdldigit { color: #ff00ff; } span.vhdlchar { color: #000000; } span.vhdlkeyword { color: #700070; } span.vhdllogic { color: #ff0000; } span.lineno { color: #6f7579; background: transparent; border-right: 1px solid #6f7579; } span.lineno a { background: transparent; } /*********************************************/ /** Modules/Directory table **/ /*********************************************/ .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { background: #ffffff; color: inherit; } .memtemplate { color: #B4CCF9; } .memSeparator { border: none; background: transparent; } h2.groupheader { color: #d20a00; border-bottom: 1px solid #343637; } /*********************************************/ /** Mem items **/ /*********************************************/ .memtitle { background: #fff !important; border-color: #000000; } .memitem { background: #fff !important; color: inherit; text-shadow: none; } .memproto { background: inherit; border-color: #000000; color: inherit; text-shadow: none; } .memproto table td { font-family: monospace, fixed !important; } td.memItemLeft, td.memItemRight { font-family: monospace, fixed; } .paramname, .paramname em { color: #000090; font-style: normal; } .memdoc { background: inherit; border-color: #000000; font-weight: 600; } /*********************************************/ /** Footer **/ /*********************************************/ .titlearea { border-bottom: 1px solid #e6e9eb; } /*********************************************/ /** Footer **/ /*********************************************/ #nav-path { background: transparent; } #nav-path ul { background: transparent; color: inherit; border: none; border-top: 1px solid #32363d; } .navpath li.footer { color: inherit; } .navpath li.navelem a { text-shadow: none; } /*********************************************/ /** Custom scrollbar **/ /*********************************************/ ::-webkit-scrollbar { width: 10px; } /* Track */ ::-webkit-scrollbar-track { border-radius: 10px; } /* Handle */ ::-webkit-scrollbar-thumb { background: #234567; border: none; } /* Handle on hover */ ::-webkit-scrollbar-thumb:hover { background: #32363d; } /*********************************************/ /** Custom scrollbar **/ /*********************************************/ h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { text-shadow: 0 0 15px #67d8ef; } 07070100000017000081A400000000000000000000000165BCF787000001E5000000000000000000000000000000000000003A00000000pdcom-3.0.11.0.gfcbffda/doc/styles/style/html_footer.html<div id="nav-path" class="navpath"> <ul> <li class="footer"> Documentation automatically created on $datetime by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="$relpath$doxygen.png" alt="doxygen" onerror="this.onerror=null;this.src='$relpath$doxygen.svg';"/> </a> . - $projectname developed by <a href="https://igh.de" target="_new"> Ingenieurgemeinschaft IgH GmbH </a>. All rights reserved. </li> </ul> </div> 07070100000018000081A400000000000000000000000165BCF78700000878000000000000000000000000000000000000003A00000000pdcom-3.0.11.0.gfcbffda/doc/styles/style/html_header.html<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen $doxygenversion"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME--> <!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME--> <link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="$relpath^jquery.js"></script> <script type="text/javascript" src="$relpath^dynsections.js"></script> $treeview $search $mathjax <link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" /> $extrastylesheet </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <!--BEGIN TITLEAREA--> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <!--BEGIN PROJECT_LOGO--> <td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td> <!--END PROJECT_LOGO--> <!--BEGIN PROJECT_NAME--> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">$projectname <!--BEGIN PROJECT_NUMBER--> <span id="projectnumber">$projectnumber</span><!--END PROJECT_NUMBER--> </div> <!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF--> </td> <!--END PROJECT_NAME--> <!--BEGIN !PROJECT_NAME--> <!--BEGIN PROJECT_BRIEF--> <td style="padding-left: 0.5em;"> <div id="projectbrief">$projectbrief</div> </td> <!--END PROJECT_BRIEF--> <!--END !PROJECT_NAME--> <!--BEGIN DISABLE_INDEX--> <!--BEGIN SEARCHENGINE--> <td>$searchbox</td> <!--END SEARCHENGINE--> <!--END DISABLE_INDEX--> </tr> </tbody> </table> </div> <!--END TITLEAREA--> <!-- end header part -->07070100000019000041ED00000000000000000000000265BCF78700000000000000000000000000000000000000000000002000000000pdcom-3.0.11.0.gfcbffda/example0707010000001A000081A400000000000000000000000165BCF78700000FB3000000000000000000000000000000000000003300000000pdcom-3.0.11.0.gfcbffda/example/ExampleProcess.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * * \file PdCom example implementation. * ****************************************************************************/ #include <iostream> using namespace std; #include "ExampleProcess.h" /****************************************************************************/ /** Constructor. */ ExampleProcess::ExampleProcess( const char *address, /**< IP address or host name. */ int port /**< TCP port number. */ ): LinuxProcess(address, port) { scale.gain = 1.0; scale.offset = 0.0; } /****************************************************************************/ /* Destructor. */ ExampleProcess::~ExampleProcess() { reset(); } /****************************************************************************/ /* Called by PdCom::Process, if protocol initialisation is complete. * * Reimplements Process::sigConnected() */ void ExampleProcess::sigConnected() { PdCom::Variable *pv; #ifdef PDCOM_HAVE_BROADCAST sendBroadcast("Hello from the example!", "text"); #endif // In our case, we choose to subscribe to our variables here. // This is not entirely necessary; it could be done any time // later, as long as it is after this call. if ((pv = findVariable("/Hydraulik/Oeltemperatur"))) { // Subscribing to a variable may fail if there are problems. // Since sigConnected() is called within the context of // newData(), we cannot rely on a global try-catch construct, // otherwise the protocol handler will get confused. // We need a local try-catch block here. try { //pv->poll(this); pv->subscribe(this, 0.2); } catch (PdCom::Exception &e) { cerr << "An error occurred while trying to subscribe " "to a variable: " << e.what() << endl; finished = true; } } if ((pv = findVariable("/Temperaturregler/Solltemperatur"))) { double v = 41.5; pv->setValue(&v); } } /****************************************************************************/ /* Notification, that a new value has arrived. * * Reimplemented from VariableSubscriber::notify(). */ void ExampleProcess::notify( PdCom::Variable *pv /**< The variable that changed */ ) { size_t nelem = pv->dimension.getElementCount(); double value[nelem]; pv->getValue(value, nelem, &scale); cout << "notify(" << pv->path << "): " << pv->getMTime().str() << endl; for (size_t i = 0; i < nelem; i++) { cout << value[i]; if (i < nelem - 1) { cout << " "; } } cout << endl; finished = true; } /****************************************************************************/ /* The subscription has been cancelled. * * Called to notify the subscriber that this subscription has * been cancelled. */ void ExampleProcess::notifyDelete( PdCom::Variable *pv /**< The variable that is deleted */ ) { } /****************************************************************************/ 0707010000001B000081A400000000000000000000000165BCF78700000704000000000000000000000000000000000000003100000000pdcom-3.0.11.0.gfcbffda/example/ExampleProcess.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include "LinuxProcess.h" /****************************************************************************/ /* Example process subclass. * * This inherits from both LinuxProcess and Subscriber, which is * allowed. Hence this process receives signals from both classes. */ class ExampleProcess: public LinuxProcess, public PdCom::Subscriber { public: /* Constructor. */ ExampleProcess(const char *, int); ~ExampleProcess(); // from PdCom::Process void sigConnected(); // from PdCom::Subscriber void notify(PdCom::Variable *); void notifyDelete(PdCom::Variable *); private: PdCom::Variable::Scale scale; }; /****************************************************************************/ 0707010000001C000081A400000000000000000000000165BCF78700001D48000000000000000000000000000000000000003100000000pdcom-3.0.11.0.gfcbffda/example/LinuxProcess.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * * \file PdCom example implementation. * ****************************************************************************/ #include <sys/types.h> #include <sys/socket.h> #include <sys/param.h> #include <fcntl.h> #include <errno.h> #include <unistd.h> #include <netinet/in.h> #include <netdb.h> // gethostbyname() #include <string.h> // memset() #include <iostream> #include <sstream> #include <cstring> using namespace std; #include "LinuxProcess.h" #include "config.h" #define DEBUG_DATA 0 /****************************************************************************/ /** Constructor. */ LinuxProcess::LinuxProcess( const char *address, /**< IP address or host name. */ int port /**< TCP port number. */ ): PdCom::Process(), finished(false), writeRequest(false) { stringstream err; struct sockaddr_in serverAddress; struct hostent *hostent; int flags; memset(&serverAddress, 0, sizeof(serverAddress)); // Get a TCP file descriptor if ((fd = ::socket(PF_INET, SOCK_STREAM, 0)) < 0) { err << "Failed to open socket: " << strerror(errno); throw Exception(err.str()); } // Connect to server serverAddress.sin_family = AF_INET; serverAddress.sin_port = htons(port); if (!(hostent = gethostbyname(address))) { err << "Failed to resolve hostname: " << strerror(errno); throw Exception(err.str()); } cerr << "Connecting to " << address << ":" << port << "..." << endl; memcpy((char *) &serverAddress.sin_addr, hostent->h_addr, sizeof(struct in_addr)); if (connect(fd, (const struct sockaddr *) &serverAddress, sizeof(serverAddress))) { err << "Failed to connect: " << strerror(errno); throw Exception(err.str()); } cerr << "Connected." << endl; // Make socket non-blocking here. This is not required by // the library, but it may be necessary in the implementation // environment, for example in a desktop application where // the event loop should never be blocked. if ((flags = fcntl(fd, F_GETFL, 0)) < 0) { err << "Failed to get flags: " << strerror(errno); throw Exception(err.str()); } flags |= O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) < 0) { err << "Failed to set flags: " << strerror(errno); throw Exception(err.str()); } } /****************************************************************************/ /** Destructor. * * Do here whatever you need to when the class has to shutdown. */ LinuxProcess::~LinuxProcess() { // Close the TCP socket close(fd); } /****************************************************************************/ /** Execute. */ void LinuxProcess::exec(void) { fd_set read_fds, write_fds; fd_set in, out, *out_p; FD_ZERO(&read_fds); FD_ZERO(&write_fds); FD_SET(fd, &read_fds); FD_SET(fd, &write_fds); while (!finished) { in = read_fds; if (writeRequest) { out = write_fds; out_p = &out; } else { out_p = NULL; } select(fd + 1, &in, out_p, NULL, NULL); if (FD_ISSET(fd, &in)) { // new data try { if (readSocket() <= 0) break; } catch (PdCom::Exception &e) { cerr << "Caught " << e.what() << endl; break; } } if (FD_ISSET(fd, &out)) { // ready to write if (writeSocket()) { cerr << "Write error." << endl; break; } } } cerr << "Finished." << endl; } /****************************************************************************/ /** Read data from TCP socket. * * If new data have arrived, send them down to PdCom::Process by calling * newData(). */ int LinuxProcess::readSocket() { int len, ret; char buf[4096]; len = ::read(fd, buf, sizeof(buf)); if (len > 0) { #if DEBUG_DATA cerr << "read: " << string(buf, len) << endl; #endif ret = newData(buf, len); return ret; } else { return len; } } /*****************************************************************************/ /* Write data to the TCP socket. */ int LinuxProcess::writeSocket() { int wrRet, retval = 0; wrRet = writeReady(); if (wrRet < 0) { // sendData() encountered an error. cerr << "writeReady() returned " << wrRet << endl; finished = true; retval = wrRet; } else if (!wrRet) { // No more data to send writeRequest = false; } return retval; } /****************************************************************************/ /** New data to send. * * This method is called within the newData() call and signals that there are * new data to be sent to the process. * * When the socket is ready to send the data, writeReady() must be called. */ void LinuxProcess::sendRequest() { writeRequest = true; } /****************************************************************************/ /** Request to send data. * * This method is called within the context of writeReady(). * * \return Number of bytes that were successfully transferred. */ int LinuxProcess::sendData( const char *buf, /**< Buffer with data to send. */ size_t len /**< Number of bytes in \a buf. */ ) { #if DEBUG_DATA cerr << "write: " << string(buf, len) << endl; #endif return ::write(fd, buf, len); } /****************************************************************************/ /** */ bool LinuxProcess::clientInteraction( const string &, const string &, const string &, list<ClientInteraction> &interactionList ) { list<ClientInteraction>::iterator it; cerr << __func__ << "()" << endl; for (it = interactionList.begin(); it != interactionList.end(); it++) { if (it->prompt == "Username") { char *login = getlogin(); if (login) it->response = login; } else if (it->prompt == "Hostname") { char hostname[256]; if (!gethostname(hostname, sizeof(hostname))) { it->response = hostname; } } else if (it->prompt == "Application") { it->response = PACKAGE " example"; } cerr << it->prompt << "=" << it->response << endl; } return true; } /****************************************************************************/ 0707010000001D000081A400000000000000000000000165BCF7870000088E000000000000000000000000000000000000002F00000000pdcom-3.0.11.0.gfcbffda/example/LinuxProcess.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * * \file PdCom example implementation. * ****************************************************************************/ #include <string> #include <stdexcept> using namespace std; #include "pdcom.h" /****************************************************************************/ /* PdCom::Process implementation for Linux. * * Uses a TCP socket to connect to the process. */ class LinuxProcess: public PdCom::Process { public: LinuxProcess(const char *, int); ~LinuxProcess(); void exec(void); /** Exception class. */ class Exception: public runtime_error { public: /** Constructor. */ Exception(const string &s /**< Message */): runtime_error(s) {}; }; protected: bool finished; private: int fd; bool writeRequest; int readSocket(); int writeSocket(); // PdCom::Process void sendRequest(); int sendData(const char *, size_t); bool clientInteraction(const string&, const std::string&, const std::string&, list<ClientInteraction>&); }; /****************************************************************************/ 0707010000001E000081A400000000000000000000000165BCF78700000596000000000000000000000000000000000000002C00000000pdcom-3.0.11.0.gfcbffda/example/Makefile.am#----------------------------------------------------------------------------- # # $Id$ # # Copyright (C) 2009 Richard Hacker <lerich@gmx.net> # Florian Pose <fp@igh-essen.com> # # This file is part of the PdCom library. # # The PdCom library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # The PdCom library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. # #----------------------------------------------------------------------------- AM_CPPFLAGS = -Wall -g #----------------------------------------------------------------------------- noinst_PROGRAMS = example example_SOURCES = LinuxProcess.cpp ExampleProcess.cpp main.cpp example_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src example_LDADD = ../src/libpdcom.la -lexpat noinst_HEADERS = \ ExampleProcess.h \ LinuxProcess.h #----------------------------------------------------------------------------- 0707010000001F000081A400000000000000000000000165BCF787000006A8000000000000000000000000000000000000002900000000pdcom-3.0.11.0.gfcbffda/example/main.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * * \file PdCom example implementation. * ****************************************************************************/ #include <iostream> using namespace std; #include "ExampleProcess.h" /****************************************************************************/ int main(int argc, const char *argv[]) { int retval = 0; try { ExampleProcess process("ihzctl", 2345); process.exec(); } catch (LinuxProcess::Exception &e) { cerr << "LinuxProcess::Exception: " << e.what() << endl; retval = 1; } catch (PdCom::Exception &e) { cerr << "PdCom::Exception: " << e.what() << endl; retval = 1; } return retval; } /****************************************************************************/ 07070100000020000081A400000000000000000000000165BCF78700000D16000000000000000000000000000000000000002600000000pdcom-3.0.11.0.gfcbffda/pdcom.spec.in#---------------------------------------------------------------------------- # # $Id$ # # Copyright (C) 2012 Richard Hacker <lerich@gmx.net> # 2012-2017 Florian Pose <fp@igh.de> # # This file is part of the PdCom library. # # The PdCom library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # The PdCom library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. # # vim: tw=78 # #---------------------------------------------------------------------------- Name: libpdcom1 Version: @VERSION@ Release: 0 License: LGPL-3.0+ Vendor: Ingenieurgemeinschaft IgH GmbH URL: http://etherlab.org/en/pdcom Source0: http://etherlab.org/download/pdcom/pdcom-%{version}.tar.bz2 BuildRoot: /tmp/%{name}-%{version} BuildRequires: gcc-c++ libexpat-devel #---------------------------------------------------------------------------- # Main Package #---------------------------------------------------------------------------- Summary: Process data communication library Group: EtherLab %description PdCom shall provide a flexible C++ API for non-realtime exchange of process data and is part of the EtherLab project (http://etherlab.org/en/pdcom). It is designed to be independent of any communication protocols and channels, and shall be usable under several operating systems and platforms. I. e. it has been tested successfully under Linux and Windows. #---------------------------------------------------------------------------- # Development package #---------------------------------------------------------------------------- %package devel Summary: Development files for PdCom Group: Development/Libraries/C and C++ Requires: %{name} = %{version} libexpat-devel %description devel PdCom shall provide a flexible C++ API for non-realtime exchange of process data and is part of the EtherLab project (http://etherlab.org/en/pdcom). It is designed to be independent of any communication protocols and channels, and shall be usable under several operating systems and platforms. I. e. it has been tested successfully under Linux and Windows. #---------------------------------------------------------------------------- %prep %setup -n pdcom-%{version} %build %configure --disable-static make %{?_smp_mflags} %install make DESTDIR=${RPM_BUILD_ROOT} install rm $RPM_BUILD_ROOT/%{_libdir}/libpdcom.la %clean rm -rf ${RPM_BUILD_ROOT} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root) %{_libdir}/libpdcom.so.* %files devel %defattr(-,root,root) %doc AUTHORS ChangeLog COPYING NEWS %{_includedir}/*.h %{_includedir}/pdcom %{_libdir}/libpdcom.so #---------------------------------------------------------------------------- %changelog * Wed Jan 8 2014 fp@igh.de - Updated for use with OBS #---------------------------------------------------------------------------- 07070100000021000041ED00000000000000000000000465BCF78700000000000000000000000000000000000000000000001C00000000pdcom-3.0.11.0.gfcbffda/src07070100000022000081A400000000000000000000000165BCF78700000BB8000000000000000000000000000000000000002500000000pdcom-3.0.11.0.gfcbffda/src/Data.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include <inttypes.h> #include "pdcom/Data.h" #define DEBUG 0 #if DEBUG #include <iostream> namespace { using std::cout; using std::cerr; using std::endl; } #endif using namespace PdCom; //////////////////////////////////////////////////////////////////////////// // class Data //////////////////////////////////////////////////////////////////////////// Data::Data(const Type& type, const Dimension& dim, const Allocator& a): type(type), dimension(dim), dataPtr(0), elementCount(dimension.getElementCount()), memSize(elementCount * getTypeWidth(type)), allocator(a) { #if DEBUG cout << __func__ << "() ctor: allocated " << memSize << " bytes" << endl; #endif } /****************************************************************************/ Data::~Data() { allocator.deallocate(dataPtr); } /****************************************************************************/ void Data::allocateMemory() { if (!dataPtr) dataPtr = allocator.allocate(elementCount, type); } /****************************************************************************/ size_t Data::getTypeWidth(Type t) { switch(t) { case bool_T: return sizeof(bool); case uint8_T: case sint8_T: return sizeof(char); case uint16_T: case sint16_T: return sizeof(uint16_t); case uint32_T: case sint32_T: return sizeof(uint32_t); case uint64_T: case sint64_T: return sizeof(uint64_t); case double_T: return sizeof(double); case single_T: return sizeof(float); } return 0; } /****************************************************************************/ const char* Data::getDataPtr(const Dimension* idx) const { #if DEBUG cout << __func__ << "(): returning " << dimension.getOffset(idx) << endl; #endif return dataPtr + dimension.getOffset(idx); } 07070100000023000081A400000000000000000000000165BCF78700000BEE000000000000000000000000000000000000002E00000000pdcom-3.0.11.0.gfcbffda/src/DataDimension.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include "pdcom/Data.h" #define DEBUG 0 #if DEBUG #include <iostream> namespace { using std::cout; using std::cerr; using std::endl; } #endif using namespace PdCom; //////////////////////////////////////////////////////////////////////////// // class Data::Dimension //////////////////////////////////////////////////////////////////////////// /****************************************************************************/ Data::Dimension::Dimension( const std::allocator<size_t>& a) : vector<size_t>(a) { } /****************************************************************************/ Data::Dimension::Dimension ( size_t n, const size_t& value, const std::allocator<size_t>& a) : vector<size_t>(n, value, a) { } /****************************************************************************/ Data::Dimension::Dimension ( const vector<size_t>::iterator& first, const vector<size_t>::iterator& last, const std::allocator<size_t>& a) : vector<size_t>(first, last, a) { } /****************************************************************************/ Data::Dimension::Dimension ( const vector<size_t>& other): vector<size_t>(other) { } /****************************************************************************/ size_t Data::Dimension::getElementCount() const { size_t n = 1; for( vector<size_t>::const_iterator it = begin(); it != end(); it++) { n *= *it; } return n; } /****************************************************************************/ unsigned int Data::Dimension::getOffset(const Dimension* element) const { if (!element) return 0; unsigned int n = (*element)[0]; unsigned int elementSize = element->size(); for (unsigned int i = 1; i < size(); i++) { n = n * (*this)[i] + i < elementSize ? (*element)[i] : 0; } // Note: this class method has optimization potential. dimX could // be cached so it doesn't need to be calculated every time return n; } 07070100000024000081A400000000000000000000000165BCF78700000792000000000000000000000000000000000000002800000000pdcom-3.0.11.0.gfcbffda/src/Makefile.am#----------------------------------------------------------------------------- # # $Id$ # # Copyright (C) 2009 Richard Hacker <lerich@gmx.net> # Florian Pose <fp@igh-essen.com> # # This file is part of the PdCom library. # # The PdCom library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # The PdCom library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. # #----------------------------------------------------------------------------- SUBDIRS = pdcom msrproto AUTOMAKE_OPTIONS = subdir-objects # pdcom.h is generated from pdcom.h.in nodist_include_HEADERS = \ pdcom.h lib_LTLIBRARIES = libpdcom.la AM_CXXFLAGS = -Wall #----------------------------------------------------------------------------- libpdcom_la_LDFLAGS = -no-undefined $(LT_VERSION_INFO) $(EXPAT_LDFLAGS) libpdcom_la_LIBADD = $(EXPAT_LIBS) libpdcom_la_CPPFLAGS = $(EXPAT_CPPFLAGS) libpdcom_la_SOURCES = \ Data.cpp \ DataDimension.cpp \ Process.cpp \ ProcessStreambuf.cpp ProcessStreambuf.h \ ProtocolHandler.cpp ProtocolHandler.h \ Time.cpp \ Variable.cpp \ VariableConvert.cpp \ msrproto/MsrChannel.cpp msrproto/MsrChannel.h \ msrproto/MsrParam.cpp msrproto/MsrParam.h \ msrproto/MsrProtocolHandler.cpp msrproto/MsrProtocolHandler.h \ msrproto/MsrVariable.cpp msrproto/MsrVariable.h \ msrproto/MsrException.h #----------------------------------------------------------------------------- 07070100000025000081A400000000000000000000000165BCF787000018B0000000000000000000000000000000000000002800000000pdcom-3.0.11.0.gfcbffda/src/Process.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #else #error No config.h #endif #include "pdcom/Process.h" #include "pdcom/Variable.h" #include "pdcom/Exception.h" #include "ProcessStreambuf.h" #include "msrproto/MsrProtocolHandler.h" #include <iostream> #include <sstream> using namespace PdCom; /*****************************************************************************/ Process::Process(unsigned int buflen): readOnly(false), sb(new ProcessStreambuf(this, buflen)), os(new std::ostream(sb)) { handler = NULL; os_flags = os->flags(); logLevel = LogInfo; } /*****************************************************************************/ Process::~Process() { reset(); delete os; delete sb; } /*****************************************************************************/ std::map<std::string,std::string> Process::getProtocolInformation() const { return handler ? handler->getInfo() : std::map<std::string,std::string>(); } /*****************************************************************************/ void Process::reset() { for (VariableSet::iterator it = variableSet.begin(); it != variableSet.end(); it++) { (*it)->cancelSubscribers(); } delete handler; handler = 0; os->clear(); os->flags(os_flags); sb->reset(); } /*****************************************************************************/ bool Process::clientInteraction( const std::string&, const std::string&, const std::string&, std::list<ClientInteraction>&) { return false; } /*****************************************************************************/ Variable* Process::findVariable(const std::string& path) const { if (!isConnected()) { protocolLog(LogWarn, "Requesting a variable before protocol " "initialisation has completed."); } for (VariableSet::const_iterator it = variableSet.begin(); it != variableSet.end(); it++) { if ((*it)->path == path) return *it; } std::stringstream err; err << "Variable \"" << path << "\" not found."; protocolLog(LogWarn, err.str()); return 0; } /*****************************************************************************/ bool Process::isConnected() const { return handler ? handler->connected() : false; } /*****************************************************************************/ void Process::newVariable(Variable *pv) { variableSet.insert(pv); } /*****************************************************************************/ void Process::rmVariable(Variable *pv) { variableSet.erase(pv); } /*****************************************************************************/ void Process::protocolInitialised() { sigConnected(); } /*****************************************************************************/ size_t Process::newData(const char *buf, size_t len) { if (!handler) { if ((handler = MSRProto::ProtocolHandler::tryParse( buf, len, this, os))) { protocolLog(LogInfo, "Autodetected MSR Protocol."); } else { throw ProtocolException("Unknown protocol"); } } len = handler->parse(buf, len); // If data is in the output buffer, call the virtual method // sendRequest() if (sb->hasData()) sendRequest(); return len; } /*****************************************************************************/ void Process::sendRequest() { while (writeReady() > 0); } /*****************************************************************************/ bool Process::hasData() const { return sb->hasData(); } /*****************************************************************************/ void Process::sigConnected() { protocolLog(LogDebug, "Protocol initialisation completed."); } /*****************************************************************************/ int Process::writeReady() { return sb->writeReady(); } /*****************************************************************************/ void Process::processMessage( const Time& time, LogLevel_t level, unsigned int messageNo, const std::string& message ) const { if (level > logLevel) return; std::cout << "<" << level << "> Message from process at " << time.str() << ": (" << messageNo << ") " << message << std::endl; } /*****************************************************************************/ void Process::protocolLog( LogLevel_t level, const std::string& message ) const { if (level > logLevel) return; std::cerr << "<" << level << "> " << message << std::endl; } /*****************************************************************************/ void Process::sendBroadcast( const std::string &message, const std::string &attr ) { if (!handler) { protocolLog(LogError, "sendBroadcast(): Protocol handler not ready."); return; } bool hadData = sb->hasData(); handler->sendBroadcast(message, attr); if (!hadData && sb->hasData()) { sendRequest(); } } /*****************************************************************************/ 07070100000026000081A400000000000000000000000165BCF78700001A57000000000000000000000000000000000000003100000000pdcom-3.0.11.0.gfcbffda/src/ProcessStreambuf.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include <stdio.h> // EOF #include <string.h> // memcpy() #include "pdcom/Process.h" #include "ProcessStreambuf.h" using namespace PdCom; #define DEBUG 0 #if DEBUG #include <iostream> #endif /*****************************************************************************/ ProcessStreambuf::ProcessStreambuf(Process* p, unsigned int buflen, unsigned int max_buffers): std::streambuf(), process(p), buflen(buflen), max_buffers(max_buffers) { reset(); } /*****************************************************************************/ ProcessStreambuf::~ProcessStreambuf() { reset(); } /*****************************************************************************/ void ProcessStreambuf::reset() { for (BufferList::iterator it = buf.begin(); it != buf.end(); it++) delete[] *it; buf.clear(); wptr = wbuf = ibuf = 0; setp(0, 0); } /*****************************************************************************/ bool ProcessStreambuf::hasData() const { // either there is more than one buffer, // or the write pointer is different from the position pointer // in the single buffer return buf.size() > 2 || (wptr && pptr() > wptr); } /*****************************************************************************/ // Called by RTCom::Process when the output stream is ready int ProcessStreambuf::writeReady() { #if DEBUG std::cerr << "ProcessStreambuf::writeReady()" << std::endl; #endif int sentSize, sizeToSend; bool sameBuffer = wbuf == ibuf; if (!wptr || pptr() == wptr) return 0; sizeToSend = sameBuffer ? pptr() - wptr : wbuf + buflen - wptr; #if DEBUG std::cerr << "Sending " << sizeToSend << " bytes from buf " << (void *) wbuf << " " << sameBuffer << std::endl; #endif sentSize = process->sendData(wptr, sizeToSend); #if DEBUG std::cerr << "Sent " << sentSize << " bytes from " << (void*) wptr << std::endl; std::cerr << "<<<< Data: " << std::string(wptr, sentSize) << std::endl; #endif if (sentSize < 0) // send error encountered; return immediately return sentSize; sentSize = std::min(sentSize, sizeToSend); if (sameBuffer) { /* Writing and reading on the same buffer */ if (sentSize == sizeToSend) { #if DEBUG std::cerr << "All buffers empty." << std::endl; #endif // move pointers to beginning of ibuf wptr = ibuf; pbump(ibuf - pptr()); } else { wptr += sentSize; } } else { /* Writing and reading on different buffers */ if (sentSize == sizeToSend) { delete wbuf; buf.pop_front(); wptr = wbuf = buf.front(); } else { wptr += sentSize; } } return hasData(); } /*****************************************************************************/ // Called when a larger buffer has to be written std::streamsize ProcessStreambuf::xsputn(const char *s, std::streamsize len) { std::streamsize n, count = 0; #if DEBUG std::cerr << "ProcessStreambuf::xsputn(" << std::string(s,len) << ")" << std::endl; #endif while (count != len) { if (pptr() == epptr()) { // Current buffer is full if (new_page() == EOF) return count; continue; } n = std::min(epptr() - pptr(), len - count); memcpy(pptr(), s + count, n); pbump(n); count += n; } process->sendRequest(); return count; } /*****************************************************************************/ // When the output buffer is full and another char has to be put, // this method is called int ProcessStreambuf::overflow(int c) { #if DEBUG std::cerr << "ProcessStreambuf::overflow(" << c << ")" << std::endl; #endif if (new_page() == EOF) return EOF; *pptr() = c; pbump(1); return 0; } /*****************************************************************************/ int ProcessStreambuf::new_page() { #if DEBUG std::cerr << "ProcessStreambuf::new_page()" << std::endl; #endif /* Tell the ProcessStreambuf class that the buffer is full. Maybe this is * successful in freeing up the buffer */ if (wbuf) { #if DEBUG std::cerr << "first calling sendRequest()" << std::endl; #endif process->sendRequest(); if (pptr() < epptr()) return 0; } // Move data to beginning of buffer if (ibuf && wbuf == ibuf && wptr != wbuf) { // Only one buffer is active and whats more, the write pointer // does not point to buffer start, meaning that we can make space // by moving the data forward. Try this first std::streamsize size = pptr() - wptr; #if DEBUG std::cerr << "moving " << size << " bytes to buffer start" << std::endl; #endif memmove(ibuf, wptr, size); pbump(wbuf - wptr); wptr = wbuf; } else { // Have to allocate new data space // If max_buffers != 0, check for max buffers if (max_buffers && buf.size() == max_buffers) { // Buffer is really full return EOF; } ibuf = new char[buflen]; #if DEBUG std::cerr << "got new buffer " << (void*)ibuf << std::endl; #endif buf.push_back(ibuf); setp(ibuf, ibuf + buflen); if (!wbuf) { wptr = wbuf = ibuf; } } return 0; } /*****************************************************************************/ int ProcessStreambuf::sync() { process->sendRequest(); return 0; } /*****************************************************************************/ 07070100000027000081A400000000000000000000000165BCF78700000990000000000000000000000000000000000000002F00000000pdcom-3.0.11.0.gfcbffda/src/ProcessStreambuf.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef PROCESS_STREAMBUF_H #define PROCESS_STREAMBUF_H #include <streambuf> #include <list> #include <cstring> namespace PdCom { class Process; /****************************************************************************/ /** Stream buffer implementation for Process. */ class ProcessStreambuf: public std::streambuf { public: ProcessStreambuf( Process *process, unsigned int buflen = 4096, unsigned int max_buffers = 0 ); virtual ~ProcessStreambuf(); bool hasData() const; int writeReady(); void reset(); private: Process * const process; const unsigned int buflen; const unsigned int max_buffers; int new_page(); // Output functions reimplemented from streambuf std::streamsize xsputn(const char *s, std::streamsize n); int overflow(int c); int sync(); char *wptr; // Write pointer of the output char *wbuf; // Current write buffer char *ibuf; // Current input buffer typedef std::list<char *> BufferList; // Buffer list. // Output buffer is the first buffer // Input buffer is the last buffer BufferList buf; }; } // namespace PdCom #endif // PROCESS_OSTREAM_H /****************************************************************************/ 07070100000028000081A400000000000000000000000165BCF78700000760000000000000000000000000000000000000003000000000pdcom-3.0.11.0.gfcbffda/src/ProtocolHandler.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include "pdcom/Process.h" #include "ProtocolHandler.h" using namespace PdCom; /****************************************************************************/ ProtocolHandler::ProtocolHandler( PdCom::Process *p, std::ostream *os): process(p), os(os) { } /****************************************************************************/ ProtocolHandler::~ProtocolHandler() { } /****************************************************************************/ size_t ProtocolHandler::parse(const char *buf, size_t len) { return len; } /****************************************************************************/ bool ProtocolHandler::connected() const { return false; } /****************************************************************************/ void ProtocolHandler::initialised() { process->protocolInitialised(); } 07070100000029000081A400000000000000000000000165BCF7870000087D000000000000000000000000000000000000002E00000000pdcom-3.0.11.0.gfcbffda/src/ProtocolHandler.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef PROTOCOLHANDLER_H #define PROTOCOLHANDLER_H #include "pdcom/Exception.h" #include <string> #include <map> namespace PdCom { class Process; /****************************************************************************/ /** Protocol handler. */ class ProtocolHandler { public: ProtocolHandler(PdCom::Process *process, std::ostream *os); virtual ~ProtocolHandler(); virtual size_t parse(const char *buf, size_t len); virtual bool connected() const; virtual bool hasFeature(const std::string &f) const = 0; Process *getProcess() const { return process; } virtual std::map<std::string,std::string> getInfo() const = 0; virtual void sendBroadcast(const std::string &, const std::string & = "text") = 0; protected: PdCom::Process * const process; std::ostream * const os; /** Call this when the protocol handler has finished initialisation. */ void initialised(); }; } // namespace PdCom #endif // PROTOCOLHANDLER_H /****************************************************************************/ 0707010000002A000081A400000000000000000000000165BCF787000013A1000000000000000000000000000000000000002500000000pdcom-3.0.11.0.gfcbffda/src/Time.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include "pdcom/Time.h" #include <sstream> using namespace PdCom; /****************************************************************************/ #define my_timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) #define my_timercmp(a, b, CMP) \ (((a)->tv_sec == (b)->tv_sec) ? \ ((a)->tv_usec CMP (b)->tv_usec) : \ ((a)->tv_sec CMP (b)->tv_sec)) #define my_timeradd(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ if ((result)->tv_usec >= 1000000) { \ ++(result)->tv_sec; \ (result)->tv_usec -= 1000000; \ } \ } while (0) #define my_timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) /****************************************************************************/ Time::Time() { my_timerclear(&t); } /****************************************************************************/ Time::Time(const Time &o) { t = o.t; } /****************************************************************************/ Time::Time(double dbltime) { *this = dbltime; } /****************************************************************************/ Time &Time::operator=(double dbltime) { t.tv_sec = (typeof(t.tv_sec)) dbltime; t.tv_usec = (typeof(t.tv_usec)) ((dbltime - t.tv_sec) * 1e6); return *this; } /****************************************************************************/ Time &Time::operator+=(const Time &dt) { my_timeradd(&t, &dt.t, &t); return *this; } /****************************************************************************/ Time &Time::operator-=(const Time &dt) { my_timersub(&t, &dt.t, &t); return *this; } /****************************************************************************/ Time Time::operator*(double d) const { return double(*this) * d; } /****************************************************************************/ Time Time::operator+(const Time &dt) const { Time res; my_timeradd(&t, &dt.t, &res.t); return res; } /****************************************************************************/ Time Time::operator-(const Time &dt) const { Time res; my_timersub(&t, &dt.t, &res.t); return res; } /****************************************************************************/ bool Time::operator>=(const Time &o) const { return my_timercmp(&t, &o.t, >=); } /****************************************************************************/ bool Time::operator>(const Time &o) const { return my_timercmp(&t, &o.t, >); } /****************************************************************************/ bool Time::operator<=(const Time &o) const { return my_timercmp(&t, &o.t, <=); } /****************************************************************************/ bool Time::operator<(const Time &o) const { return my_timercmp(&t, &o.t, <); } /****************************************************************************/ Time::operator double() const { return (double) t.tv_sec + t.tv_usec / 1e6; } /****************************************************************************/ Time::operator bool() const { return !(t.tv_sec == 0 && t.tv_usec == 0); } /****************************************************************************/ bool Time::operator==(const Time &o) const { return t.tv_sec == o.t.tv_sec && t.tv_usec == o.t.tv_usec; } /****************************************************************************/ std::string Time::str() const { std::ostringstream os; os << t.tv_sec << "."; os.fill('0'); os.width(6); os << t.tv_usec; return os.str(); } /****************************************************************************/ 0707010000002B000081A400000000000000000000000165BCF78700004D61000000000000000000000000000000000000002900000000pdcom-3.0.11.0.gfcbffda/src/Variable.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include "pdcom/Variable.h" #include "pdcom/Process.h" #include "pdcom/Subscriber.h" #include "ProtocolHandler.h" #define DEBUG 0 #if DEBUG #include <iostream> using std::cout; using std::cerr; using std::endl; #endif using namespace PdCom; /****************************************************************************/ // Static members Time Variable::nullTime; /****************************************************************************/ Variable::Variable( Process *process, const std::string &path, const std::string &alias, const Data::Type& type, const Data::Dimension& dim, double samplePeriod ): Data(type, dim), process(process), path(path), alias(alias), samplePeriod(samplePeriod), readable(true), writeable(false), read(read_convert[type]), write(write_convert[type]), read_noscale(read_convert_noscale[type]), write_noscale(write_convert_noscale[type]) { if (!dimension.getElementCount() or !dimension.size()) throw Data::Dimension::ZeroDimensionException(); process->newVariable(this); mtime = nullTime; } /****************************************************************************/ Variable::~Variable() { process->rmVariable(this); } /****************************************************************************/ void Variable::cancelSubscribers() { #if DEBUG cout << __func__ << "() for " << path << endl; #endif for (DecimationSubscribers::iterator it = decimationSubscribers.begin(); it != decimationSubscribers.end(); it++) { if (it->first == -1) continue; for (Subscribers::iterator sit = it->second.begin(); sit != it->second.end(); sit++) { (*sit)->notifyDelete(this); decimationSubscribers[-1].erase(*sit); } } for (Subscribers::iterator it = decimationSubscribers[-1].begin(); it != decimationSubscribers[-1].end(); it++) { (*it)->notifyDelete(this); } #if DEBUG cout << __func__ << "() finished" << endl; #endif } /****************************************************************************/ void Variable::poll(Subscriber* vs) { #if DEBUG cout << __func__ << "()" << vs << endl; #endif if (decimationSubscribers.empty()) { allocateMemory(); } decimationSubscribers[-1].insert(vs); pollVariable(); } /****************************************************************************/ void Variable::subscribe(Subscriber* vs, double interval) { #if DEBUG cout << __func__ << "()" << vs << " interval " << interval << endl; #endif // Put the variable subscription on the list. Note that it MUST be // excluded that a subscription adds itself twice! The subscription // object must take care of it. if (interval < 0) throw VariableException("Negative intervals in subscribe not allowed"); if (decimationSubscribers.empty()) { allocateMemory(); } removeStreamSubscribers(vs); unsigned int decimation = addTransmissionInterval(interval); subscriberMap[vs] = decimation; decimationSubscribers[decimation].insert(vs); } /****************************************************************************/ void Variable::unsubscribe(Subscriber* vs) { #if DEBUG cout << __func__ << "()" << vs << " decimation " << endl; #endif removeStreamSubscribers(vs); decimationSubscribers[-1].erase(vs); } /****************************************************************************/ void Variable::removeStreamSubscribers(Subscriber* vs) { #if DEBUG cout << __func__ << "()" << vs << endl; #endif if (subscriberMap.find(vs) == subscriberMap.end()) return; unsigned int decimation = subscriberMap[vs]; #if DEBUG cout << __func__ << "()" << vs << " decimation " << decimation << endl; #endif decimationSubscribers[decimation].erase(vs); if (decimationSubscribers[decimation].empty()) { rmTransmissionDecimation(decimation); } } /****************************************************************************/ void Variable::notifySubscribers(unsigned int decimation) { Subscribers& s = decimationSubscribers[decimation]; // Iterate over the subscribers informing them of the new value for (Subscribers::iterator it = s.begin(); it != s.end(); it++) { (*it)->notify(this); } } /****************************************************************************/ void Variable::notifyPoll() { for (Subscribers::iterator it = decimationSubscribers[-1].begin(); it != decimationSubscribers[-1].end(); it++) { (*it)->notify(this); } decimationSubscribers[-1].clear(); } /****************************************************************************/ void Variable::valueChanged(const char*, size_t) { } /***************************************************************************** ****************************************************************************/ void Variable::getValue(double* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[double_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[double_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(float* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[single_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[single_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(uint8_t* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[uint8_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[uint8_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(int8_t* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[sint8_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[sint8_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(uint16_t* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[uint16_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[uint16_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(int16_t* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[sint16_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[sint16_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(uint32_t* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[uint32_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[uint32_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(int32_t* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[sint32_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[sint32_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(uint64_t* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[uint64_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[uint64_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(int64_t* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[sint64_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[sint64_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(bool* dst, size_t len, const Scale* scale, const Dimension* idx) const { if (scale) read[bool_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, scale); else read_noscale[bool_T](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst, len, 0); } /****************************************************************************/ void Variable::getValue(Data& dst, const Scale* scale, const Dimension* idx) const { #if 0 cout << __func__ << "(): value is " << *(double*)src.getDataPtr(idx) << endl; #endif if (scale) read[dst.type](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst.dataPtr, dst.dimension.getElementCount(), scale); else read_noscale[dst.type](dataPtr + (idx ? dimension.getOffset(idx) : 0), dst.dataPtr, dst.dimension.getElementCount(), 0); } /***************************************************************************** ****************************************************************************/ void Variable::setValue(const double* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const float* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const uint8_t* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const int8_t* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const uint16_t* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const int16_t* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const uint32_t* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const int32_t* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const uint64_t* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const int64_t* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const bool* src, size_t len, const Scale* scale, const Dimension* idx) { if (process->readOnly or !writeable) return; valueChanged(pushValue(src, len, scale, idx), len); } /****************************************************************************/ void Variable::setValue(const Data& src, const Scale* scale, const Dimension* idx) { #if DEBUG cout << __func__ << "(): value is " << *(double*)src.getDataPtr(idx) << endl; #endif if (process->readOnly or !writeable) return; char* start = dataPtr + dimension.getOffset(idx); size_t len = src.dimension.getElementCount(); if (scale) write[src.type](src.dataPtr, start, len, scale); else write_noscale[src.type](src.dataPtr, start, len, 0); valueChanged(start, len); } /***************************************************************************** ****************************************************************************/ char* Variable::pushValue(const double* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[double_T](src, start, len, scale); else write_noscale[double_T](src, start, len, 0); return start; } /****************************************************************************/ char* Variable::pushValue(const float* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[single_T](src, start, len, scale); else write_noscale[single_T](src, start, len, 0); return start; } /****************************************************************************/ char* Variable::pushValue(const uint8_t* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[uint8_T](src, start, len, scale); else write_noscale[uint8_T](src, start, len, 0); return start; } /****************************************************************************/ char* Variable::pushValue(const int8_t* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[sint8_T](src, start, len, scale); else write_noscale[sint8_T](src, start, len, 0); return start; } /****************************************************************************/ char* Variable::pushValue(const uint16_t* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[uint16_T](src, start, len, scale); else write_noscale[uint16_T](src, start, len, 0); return start; } /****************************************************************************/ char* Variable::pushValue(const int16_t* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[sint16_T](src, start, len, scale); else write_noscale[sint16_T](src, start, len, 0); return start; } /****************************************************************************/ char* Variable::pushValue(const uint32_t* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[uint32_T](src, start, len, scale); else write_noscale[uint32_T](src, start, len, 0); return start; } /****************************************************************************/ char* Variable::pushValue(const int32_t* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[sint32_T](src, start, len, scale); else write_noscale[sint32_T](src, start, len, 0); return start; } /****************************************************************************/ char* Variable::pushValue(const uint64_t* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[uint64_T](src, start, len, scale); else write_noscale[uint64_T](src, start, len, 0); return start; } /****************************************************************************/ char* Variable::pushValue(const int64_t* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[sint64_T](src, start, len, scale); else write_noscale[sint64_T](src, start, len, 0); return start; } /****************************************************************************/ char* Variable::pushValue(const bool* src, size_t len, const Scale* scale, const Dimension* idx) { char* start = dataPtr + (idx ? dimension.getOffset(idx) : 0); if (scale) write[bool_T](src, start, len, scale); else write_noscale[bool_T](src, start, len, 0); return start; } 0707010000002C000081A400000000000000000000000165BCF78700012E3F000000000000000000000000000000000000003000000000pdcom-3.0.11.0.gfcbffda/src/VariableConvert.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include "pdcom/Variable.h" #define DEBUG_CONVERSIONS 0 #if DEBUG_CONVERSIONS #include <iostream> using std::cout; using std::cerr; using std::endl; #endif using namespace PdCom; // ************** bool_t -> *************************** void Variable::boolToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToBool" << endl; #endif //(dst, src, datawidth[bool_T] * count); for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = ((bool*)src)[i]; } } void Variable::boolToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t(((bool*)src)[i] == true); } } void Variable::boolToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t(((bool*)src)[i] == true); } } void Variable::boolToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t(((bool*)src)[i] == true); } } void Variable::boolToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t(((bool*)src)[i] == true); } } void Variable::boolToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t(((bool*)src)[i] == true); } } void Variable::boolToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t(((bool*)src)[i] == true); } } void Variable::boolToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t(((bool*)src)[i] == true); } } void Variable::boolToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t(((bool*)src)[i] == true); } } void Variable::boolToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float(((bool*)src)[i]); } } void Variable::boolToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double(((bool*)src)[i]); } } void Variable::write_boolToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( ((((bool*)src)[i] == true) - scale->offset) / scale->gain ); } } void Variable::write_boolToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( ((((bool*)src)[i] == true) - scale->offset) / scale->gain ); } } void Variable::read_boolToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( scale->gain * (((bool*)src)[i] == true) + scale->offset ); } } void Variable::read_boolToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "boolToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((bool*)src)[i] == true) + scale->offset ); } } // ************** uint8_t -> *************************** void Variable::uint8ToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((uint8_t*)src)[i]) ? true : false; } } void Variable::uint8ToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToUint8" << endl; #endif //(dst, src, datawidth[uint8_T] * count); for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = ((uint8_t*)src)[i]; } } void Variable::uint8ToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t(((uint8_t*)src)[i]); } } void Variable::uint8ToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t(((uint8_t*)src)[i]); } } void Variable::uint8ToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t(((uint8_t*)src)[i]); } } void Variable::uint8ToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t(((uint8_t*)src)[i]); } } void Variable::uint8ToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t(((uint8_t*)src)[i]); } } void Variable::uint8ToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t(((uint8_t*)src)[i]); } } void Variable::uint8ToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t(((uint8_t*)src)[i]); } } void Variable::uint8ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float(((uint8_t*)src)[i]); } } void Variable::uint8ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double(((uint8_t*)src)[i]); } } void Variable::write_uint8ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float((((uint8_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::write_uint8ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double((((uint8_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::read_uint8ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float(scale->gain * (((uint8_t*)src)[i]) + scale->offset); } } void Variable::read_uint8ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint8ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((uint8_t*)src)[i]) + scale->offset); } } // ************** int8_t -> *************************** void Variable::sint8ToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((int8_t*)src)[i]) ? true : false; } } void Variable::sint8ToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t(((int8_t*)src)[i]); } } void Variable::sint8ToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToSint8" << endl; #endif //(dst, src, datawidth[sint8_T] * count); for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = ((int8_t*)src)[i]; } } void Variable::sint8ToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t(((int8_t*)src)[i]); } } void Variable::sint8ToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t(((int8_t*)src)[i]); } } void Variable::sint8ToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t(((int8_t*)src)[i]); } } void Variable::sint8ToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t(((int8_t*)src)[i]); } } void Variable::sint8ToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t(((int8_t*)src)[i]); } } void Variable::sint8ToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t(((int8_t*)src)[i]); } } void Variable::sint8ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float(((int8_t*)src)[i]); } } void Variable::sint8ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double(((int8_t*)src)[i]); } } void Variable::write_sint8ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( (((int8_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::write_sint8ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( (((int8_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::read_sint8ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( scale->gain * (((int8_t*)src)[i]) + scale->offset); } } void Variable::read_sint8ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint8ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((int8_t*)src)[i]) + scale->offset); } } // ************** uint16_t -> *************************** void Variable::uint16ToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((uint16_t*)src)[i]) ? true : false; } } void Variable::uint16ToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t(((uint16_t*)src)[i]); } } void Variable::uint16ToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t(((uint16_t*)src)[i]); } } void Variable::uint16ToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToUint16" << endl; #endif //(dst, src, datawidth[uint16_T] * count); for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = ((uint16_t*)src)[i]; } } void Variable::uint16ToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t(((uint16_t*)src)[i]); } } void Variable::uint16ToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t(((uint16_t*)src)[i]); } } void Variable::uint16ToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t(((uint16_t*)src)[i]); } } void Variable::uint16ToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t(((uint16_t*)src)[i]); } } void Variable::uint16ToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t(((uint16_t*)src)[i]); } } void Variable::uint16ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float(((uint16_t*)src)[i]); } } void Variable::uint16ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double(((uint16_t*)src)[i]); } } void Variable::write_uint16ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( (((uint16_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::write_uint16ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( (((uint16_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::read_uint16ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( scale->gain * (((uint16_t*)src)[i]) + scale->offset); } } void Variable::read_uint16ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint16ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((uint16_t*)src)[i]) + scale->offset); } } // ************** int16_t -> *************************** void Variable::sint16ToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((int16_t*)src)[i]) ? true : false; } } void Variable::sint16ToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t(((int16_t*)src)[i]); } } void Variable::sint16ToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t(((int16_t*)src)[i]); } } void Variable::sint16ToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t(((int16_t*)src)[i]); } } void Variable::sint16ToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToSint16" << endl; #endif //(dst, src, datawidth[sint16_T] * count); for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = ((int16_t*)src)[i]; } } void Variable::sint16ToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t(((int16_t*)src)[i]); } } void Variable::sint16ToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t(((int16_t*)src)[i]); } } void Variable::sint16ToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t(((int16_t*)src)[i]); } } void Variable::sint16ToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t(((int16_t*)src)[i]); } } void Variable::sint16ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float(((int16_t*)src)[i]); } } void Variable::sint16ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double(((int16_t*)src)[i]); } } void Variable::write_sint16ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( (((int16_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::write_sint16ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( (((int16_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::read_sint16ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( scale->gain * (((int16_t*)src)[i]) + scale->offset); } } void Variable::read_sint16ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint16ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((int16_t*)src)[i]) + scale->offset); } } // ************** uint32_t -> *************************** void Variable::uint32ToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((uint32_t*)src)[i]) ? true : false; } } void Variable::uint32ToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t(((uint32_t*)src)[i]); } } void Variable::uint32ToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t(((uint32_t*)src)[i]); } } void Variable::uint32ToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t(((uint32_t*)src)[i]); } } void Variable::uint32ToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t(((uint32_t*)src)[i]); } } void Variable::uint32ToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToUint32" << endl; #endif //(dst, src, datawidth[uint32_T] * count); for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = ((uint32_t*)src)[i]; } } void Variable::uint32ToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t(((uint32_t*)src)[i]); } } void Variable::uint32ToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t(((uint32_t*)src)[i]); } } void Variable::uint32ToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t(((uint32_t*)src)[i]); } } void Variable::uint32ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float(((uint32_t*)src)[i]); } } void Variable::uint32ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double(((uint32_t*)src)[i]); } } void Variable::write_uint32ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( (((uint32_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::write_uint32ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( (((uint32_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::read_uint32ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( scale->gain * (((uint32_t*)src)[i]) + scale->offset); } } void Variable::read_uint32ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint32ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((uint32_t*)src)[i]) + scale->offset); } } // ************** int32_t -> *************************** void Variable::sint32ToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((int32_t*)src)[i]) ? true : false; } } void Variable::sint32ToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t(((int32_t*)src)[i]); } } void Variable::sint32ToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t(((int32_t*)src)[i]); } } void Variable::sint32ToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t(((int32_t*)src)[i]); } } void Variable::sint32ToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t(((int32_t*)src)[i]); } } void Variable::sint32ToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t(((int32_t*)src)[i]); } } void Variable::sint32ToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToSint32" << endl; #endif //(dst, src, datawidth[sint32_T] * count); for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = ((int32_t*)src)[i]; } } void Variable::sint32ToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t(((int32_t*)src)[i]); } } void Variable::sint32ToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t(((int32_t*)src)[i]); } } void Variable::sint32ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float(((int32_t*)src)[i]); } } void Variable::sint32ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double(((int32_t*)src)[i]); } } void Variable::write_sint32ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( (((int32_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::write_sint32ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( (((int32_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::read_sint32ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( scale->gain * (((int32_t*)src)[i]) + scale->offset); } } void Variable::read_sint32ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint32ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((int32_t*)src)[i]) + scale->offset); } } // ************** uint64_t -> *************************** void Variable::uint64ToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((uint64_t*)src)[i]) ? true : false; } } void Variable::uint64ToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t(((uint64_t*)src)[i]); } } void Variable::uint64ToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t(((uint64_t*)src)[i]); } } void Variable::uint64ToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t(((uint64_t*)src)[i]); } } void Variable::uint64ToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t(((uint64_t*)src)[i]); } } void Variable::uint64ToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t(((uint64_t*)src)[i]); } } void Variable::uint64ToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t(((uint64_t*)src)[i]); } } void Variable::uint64ToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToUint64" << endl; #endif //(dst, src, datawidth[uint64_T] * count); for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = ((uint64_t*)src)[i]; } } void Variable::uint64ToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t(((uint64_t*)src)[i]); } } void Variable::uint64ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float(((uint64_t*)src)[i]); } } void Variable::uint64ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double(((uint64_t*)src)[i]); } } void Variable::write_uint64ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( (((uint64_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::write_uint64ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( (((uint64_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::read_uint64ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( scale->gain * (((uint64_t*)src)[i]) + scale->offset); } } void Variable::read_uint64ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "uint64ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((uint64_t*)src)[i]) + scale->offset); } } // ************** int64_t -> *************************** void Variable::sint64ToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((int64_t*)src)[i]) ? true : false; } } void Variable::sint64ToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t(((int64_t*)src)[i]); } } void Variable::sint64ToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t(((int64_t*)src)[i]); } } void Variable::sint64ToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t(((int64_t*)src)[i]); } } void Variable::sint64ToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t(((int64_t*)src)[i]); } } void Variable::sint64ToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t(((int64_t*)src)[i]); } } void Variable::sint64ToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t(((int64_t*)src)[i]); } } void Variable::sint64ToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t(((int64_t*)src)[i]); } } void Variable::sint64ToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToSint64" << endl; #endif //(dst, src, datawidth[sint64_T] * count); for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = ((int64_t*)src)[i]; } } void Variable::sint64ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float(((int64_t*)src)[i]); } } void Variable::sint64ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double(((int64_t*)src)[i]); } } void Variable::write_sint64ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( (((int64_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::write_sint64ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( (((int64_t*)src)[i] - scale->offset) / scale->gain); } } void Variable::read_sint64ToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( scale->gain * (((int64_t*)src)[i]) + scale->offset); } } void Variable::read_sint64ToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "sint64ToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((int64_t*)src)[i]) + scale->offset); } } // ************** single_t -> *************************** void Variable::singleToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = ((float*)src)[i] ? true : false; } } void Variable::singleToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t( ((float*)src)[i]); } } void Variable::singleToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t( ((float*)src)[i]); } } void Variable::singleToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t( ((float*)src)[i]); } } void Variable::singleToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t( ((float*)src)[i]); } } void Variable::singleToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t( ((float*)src)[i]); } } void Variable::singleToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t( ((float*)src)[i]); } } void Variable::singleToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t( ((float*)src)[i]); } } void Variable::singleToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t( ((float*)src)[i]); } } void Variable::singleToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSingle" << endl; #endif //(dst, src, datawidth[single_T] * count); for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = ((float*)src)[i]; } } void Variable::singleToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( ((float*)src)[i]); } } void Variable::write_singleToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((float*)src)[i] - scale->offset) ? true : false; } } void Variable::write_singleToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t( (((float*)src)[i] - scale->offset) / scale->gain); } } void Variable::write_singleToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t( (((float*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_singleToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t( (((float*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_singleToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t( (((float*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_singleToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t( (((float*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_singleToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t( (((float*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_singleToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t( (((float*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_singleToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t( (((float*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_singleToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( (((float*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_singleToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( (((float*)src)[i] - scale->offset) / scale->gain ); } } void Variable::read_singleToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((float*)src)[i] + scale->offset) ? true : false; } } void Variable::read_singleToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t( scale->gain * (((float*)src)[i]) + scale->offset); } } void Variable::read_singleToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t( scale->gain * (((float*)src)[i]) + scale->offset); } } void Variable::read_singleToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t( scale->gain * (((float*)src)[i]) + scale->offset); } } void Variable::read_singleToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t( scale->gain * (((float*)src)[i]) + scale->offset); } } void Variable::read_singleToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t( scale->gain * (((float*)src)[i]) + scale->offset); } } void Variable::read_singleToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t( scale->gain * (((float*)src)[i]) + scale->offset); } } void Variable::read_singleToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t( scale->gain * (((float*)src)[i]) + scale->offset); } } void Variable::read_singleToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t( scale->gain * (((float*)src)[i]) + scale->offset); } } void Variable::read_singleToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( scale->gain * (((float*)src)[i]) + scale->offset); } } void Variable::read_singleToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "singleToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((float*)src)[i]) + scale->offset); } } // ************** double_t -> *************************** void Variable::doubleToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = ((double*)src)[i] ? true : false; } } void Variable::doubleToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t( ((double*)src)[i]); } } void Variable::doubleToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t( ((double*)src)[i]); } } void Variable::doubleToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t( ((double*)src)[i]); } } void Variable::doubleToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t( ((double*)src)[i]); } } void Variable::doubleToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t( ((double*)src)[i]); } } void Variable::doubleToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t( ((double*)src)[i]); } } void Variable::doubleToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t( ((double*)src)[i]); } } void Variable::doubleToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t( ((double*)src)[i]); } } void Variable::doubleToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( ((double*)src)[i]); } } void Variable::doubleToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToDouble" << endl; #endif //(dst, src, datawidth[double_T] * count); for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = ((double*)src)[i]; } } void Variable::write_doubleToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((double*)src)[i] - scale->offset) ? true : false; } } void Variable::write_doubleToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t( (((double*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_doubleToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t( (((double*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_doubleToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t( (((double*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_doubleToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t( (((double*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_doubleToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t( (((double*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_doubleToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t( (((double*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_doubleToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t( (((double*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_doubleToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t( (((double*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_doubleToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( (((double*)src)[i] - scale->offset) / scale->gain ); } } void Variable::write_doubleToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( (((double*)src)[i] - scale->offset) / scale->gain ); } } void Variable::read_doubleToBool( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToBool" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((bool*)dst)[i] = (((double*)src)[i] + scale->offset) ? true : false; } } void Variable::read_doubleToUint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint8_t*)dst)[i] = uint8_t( scale->gain * (((double*)src)[i]) + scale->offset); } } void Variable::read_doubleToSint8( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint8" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int8_t*)dst)[i] = int8_t( scale->gain * (((double*)src)[i]) + scale->offset); } } void Variable::read_doubleToUint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint16_t*)dst)[i] = uint16_t( scale->gain * (((double*)src)[i]) + scale->offset); } } void Variable::read_doubleToSint16( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint16" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int16_t*)dst)[i] = int16_t( scale->gain * (((double*)src)[i]) + scale->offset); } } void Variable::read_doubleToUint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint32_t*)dst)[i] = uint32_t( scale->gain * (((double*)src)[i]) + scale->offset); } } void Variable::read_doubleToSint32( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint32" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int32_t*)dst)[i] = int32_t( scale->gain * (((double*)src)[i]) + scale->offset); } } void Variable::read_doubleToUint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToUint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((uint64_t*)dst)[i] = uint64_t( scale->gain * (((double*)src)[i]) + scale->offset); } } void Variable::read_doubleToSint64( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSint64" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((int64_t*)dst)[i] = int64_t( scale->gain * (((double*)src)[i]) + scale->offset); } } void Variable::read_doubleToSingle( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToSingle" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((float*)dst)[i] = float( scale->gain * (((double*)src)[i]) + scale->offset); } } void Variable::read_doubleToDouble( const void *src, void *dst, size_t count, const Variable::Scale *scale) { #if DEBUG_CONVERSIONS cerr << "doubleToDouble" << endl; #endif for (unsigned int i = 0; i < count; i++) { ((double*)dst)[i] = double( scale->gain * (((double*)src)[i]) + scale->offset); } } // ***** DEPENDS ON dtype_d ***** // Usage: read_convert[rt_dtype][user_dtype] const Variable::convert_t Variable::read_convert[11][11] = { { boolToBool, boolToUint8, boolToSint8, boolToUint16, boolToSint16, boolToUint32, boolToSint32, boolToUint64, boolToSint64, read_boolToSingle, read_boolToDouble, }, { uint8ToBool, uint8ToUint8, uint8ToSint8, uint8ToUint16, uint8ToSint16, uint8ToUint32, uint8ToSint32, uint8ToUint64, uint8ToSint64, read_uint8ToSingle, read_uint8ToDouble, }, { sint8ToBool, sint8ToUint8, sint8ToSint8, sint8ToUint16, sint8ToSint16, sint8ToUint32, sint8ToSint32, sint8ToUint64, sint8ToSint64, read_sint8ToSingle, read_sint8ToDouble, }, { uint16ToBool, uint16ToUint8, uint16ToSint8, uint16ToUint16, uint16ToSint16, uint16ToUint32, uint16ToSint32, uint16ToUint64, uint16ToSint64, read_uint16ToSingle, read_uint16ToDouble, }, { sint16ToBool, sint16ToUint8, sint16ToSint8, sint16ToUint16, sint16ToSint16, sint16ToUint32, sint16ToSint32, sint16ToUint64, sint16ToSint64, read_sint16ToSingle, read_sint16ToDouble, }, { uint32ToBool, uint32ToUint8, uint32ToSint8, uint32ToUint16, uint32ToSint16, uint32ToUint32, uint32ToSint32, uint32ToUint64, uint32ToSint64, read_uint32ToSingle, read_uint32ToDouble, }, { sint32ToBool, sint32ToUint8, sint32ToSint8, sint32ToUint16, sint32ToSint16, sint32ToUint32, sint32ToSint32, sint32ToUint64, sint32ToSint64, read_sint32ToSingle, read_sint32ToDouble, }, { uint64ToBool, uint64ToUint8, uint64ToSint8, uint64ToUint16, uint64ToSint16, uint64ToUint32, uint64ToSint32, uint64ToUint64, uint64ToSint64, read_uint64ToSingle, read_uint64ToDouble, }, { sint64ToBool, sint64ToUint8, sint64ToSint8, sint64ToUint16, sint64ToSint16, sint64ToUint32, sint64ToSint32, sint64ToUint64, sint64ToSint64, read_sint64ToSingle, read_sint64ToDouble, }, { read_singleToBool, read_singleToUint8, read_singleToSint8, read_singleToUint16, read_singleToSint16, read_singleToUint32, read_singleToSint32, read_singleToUint64, read_singleToSint64, read_singleToSingle, read_singleToDouble, }, { read_doubleToBool, read_doubleToUint8, read_doubleToSint8, read_doubleToUint16, read_doubleToSint16, read_doubleToUint32, read_doubleToSint32, read_doubleToUint64, read_doubleToSint64, read_doubleToSingle, read_doubleToDouble, }, }; // ***** DEPENDS ON dtype_d ***** // Usage: write_convert[rt_dtype][user_dtype] const Variable::convert_t Variable::write_convert[11][11] = { { boolToBool, uint8ToBool, sint8ToBool, uint16ToBool, sint16ToBool, uint32ToBool, sint32ToBool, uint64ToBool, sint64ToBool, write_singleToBool, write_doubleToBool, }, { boolToUint8, uint8ToUint8, sint8ToUint8, uint16ToUint8, sint16ToUint8, uint32ToUint8, sint32ToUint8, uint64ToUint8, sint64ToUint8, write_singleToUint8, write_doubleToUint8, }, { boolToSint8, uint8ToSint8, sint8ToSint8, uint16ToSint8, sint16ToSint8, uint32ToSint8, sint32ToSint8, uint64ToSint8, sint64ToSint8, write_singleToSint8, write_doubleToSint8, }, { boolToUint16, uint8ToUint16, sint8ToUint16, uint16ToUint16, sint16ToUint16, uint32ToUint16, sint32ToUint16, uint64ToUint16, sint64ToUint16, write_singleToUint16, write_doubleToUint16, }, { boolToSint16, uint8ToSint16, sint8ToSint16, uint16ToSint16, sint16ToSint16, uint32ToSint16, sint32ToSint16, uint64ToSint16, sint64ToSint16, write_singleToSint16, write_doubleToSint16, }, { boolToUint32, uint8ToUint32, sint8ToUint32, uint16ToUint32, sint16ToUint32, uint32ToUint32, sint32ToUint32, uint64ToUint32, sint64ToUint32, write_singleToUint32, write_doubleToUint32, }, { boolToSint32, uint8ToSint32, sint8ToSint32, uint16ToSint32, sint16ToSint32, uint32ToSint32, sint32ToSint32, uint64ToSint32, sint64ToSint32, write_singleToSint32, write_doubleToSint32, }, { boolToUint64, uint8ToUint64, sint8ToUint64, uint16ToUint64, sint16ToUint64, uint32ToUint64, sint32ToUint64, uint64ToUint64, sint64ToUint64, write_singleToUint64, write_doubleToUint64, }, { boolToSint64, uint8ToSint64, sint8ToSint64, uint16ToSint64, sint16ToSint64, uint32ToSint64, sint32ToSint64, uint64ToSint64, sint64ToSint64, write_singleToSint64, write_doubleToSint64, }, { write_boolToSingle, write_uint8ToSingle, write_sint8ToSingle, write_uint16ToSingle, write_sint16ToSingle, write_uint32ToSingle, write_sint32ToSingle, write_uint64ToSingle, write_sint64ToSingle, write_singleToSingle, write_doubleToSingle, }, { write_boolToDouble, write_uint8ToDouble, write_sint8ToDouble, write_uint16ToDouble, write_sint16ToDouble, write_uint32ToDouble, write_sint32ToDouble, write_uint64ToDouble, write_sint64ToDouble, write_singleToDouble, write_doubleToDouble, }, }; // ***** DEPENDS ON dtype_d ***** // Usage: read_convert_noscale[from_dtype][to_dtype] const Variable::convert_t Variable::read_convert_noscale[11][11] = { { boolToBool, boolToUint8, boolToSint8, boolToUint16, boolToSint16, boolToUint32, boolToSint32, boolToUint64, boolToSint64, boolToSingle, boolToDouble, }, { uint8ToBool, uint8ToUint8, uint8ToSint8, uint8ToUint16, uint8ToSint16, uint8ToUint32, uint8ToSint32, uint8ToUint64, uint8ToSint64, uint8ToSingle, uint8ToDouble, }, { sint8ToBool, sint8ToUint8, sint8ToSint8, sint8ToUint16, sint8ToSint16, sint8ToUint32, sint8ToSint32, sint8ToUint64, sint8ToSint64, sint8ToSingle, sint8ToDouble, }, { uint16ToBool, uint16ToUint8, uint16ToSint8, uint16ToUint16, uint16ToSint16, uint16ToUint32, uint16ToSint32, uint16ToUint64, uint16ToSint64, uint16ToSingle, uint16ToDouble, }, { sint16ToBool, sint16ToUint8, sint16ToSint8, sint16ToUint16, sint16ToSint16, sint16ToUint32, sint16ToSint32, sint16ToUint64, sint16ToSint64, sint16ToSingle, sint16ToDouble, }, { uint32ToBool, uint32ToUint8, uint32ToSint8, uint32ToUint16, uint32ToSint16, uint32ToUint32, uint32ToSint32, uint32ToUint64, uint32ToSint64, uint32ToSingle, uint32ToDouble, }, { sint32ToBool, sint32ToUint8, sint32ToSint8, sint32ToUint16, sint32ToSint16, sint32ToUint32, sint32ToSint32, sint32ToUint64, sint32ToSint64, sint32ToSingle, sint32ToDouble, }, { uint64ToBool, uint64ToUint8, uint64ToSint8, uint64ToUint16, uint64ToSint16, uint64ToUint32, uint64ToSint32, uint64ToUint64, uint64ToSint64, uint64ToSingle, uint64ToDouble, }, { sint64ToBool, sint64ToUint8, sint64ToSint8, sint64ToUint16, sint64ToSint16, sint64ToUint32, sint64ToSint32, sint64ToUint64, sint64ToSint64, sint64ToSingle, sint64ToDouble, }, { singleToBool, singleToUint8, singleToSint8, singleToUint16, singleToSint16, singleToUint32, singleToSint32, singleToUint64, singleToSint64, singleToSingle, singleToDouble, }, { doubleToBool, doubleToUint8, doubleToSint8, doubleToUint16, doubleToSint16, doubleToUint32, doubleToSint32, doubleToUint64, doubleToSint64, doubleToSingle, doubleToDouble, }, }; // Usage: write_convert_noscale[rt_dtype][user_dtype] const Variable::convert_t Variable::write_convert_noscale[11][11] = { { boolToBool, uint8ToBool, sint8ToBool, uint16ToBool, sint16ToBool, uint32ToBool, sint32ToBool, uint64ToBool, sint64ToBool, singleToBool, doubleToBool, }, { boolToUint8, uint8ToUint8, sint8ToUint8, uint16ToUint8, sint16ToUint8, uint32ToUint8, sint32ToUint8, uint64ToUint8, sint64ToUint8, singleToUint8, doubleToUint8, }, { boolToSint8, uint8ToSint8, sint8ToSint8, uint16ToSint8, sint16ToSint8, uint32ToSint8, sint32ToSint8, uint64ToSint8, sint64ToSint8, singleToSint8, doubleToSint8, }, { boolToUint16, uint8ToUint16, sint8ToUint16, uint16ToUint16, sint16ToUint16, uint32ToUint16, sint32ToUint16, uint64ToUint16, sint64ToUint16, singleToUint16, doubleToUint16, }, { boolToSint16, uint8ToSint16, sint8ToSint16, uint16ToSint16, sint16ToSint16, uint32ToSint16, sint32ToSint16, uint64ToSint16, sint64ToSint16, singleToSint16, doubleToSint16, }, { boolToUint32, uint8ToUint32, sint8ToUint32, uint16ToUint32, sint16ToUint32, uint32ToUint32, sint32ToUint32, uint64ToUint32, sint64ToUint32, singleToUint32, doubleToUint32, }, { boolToSint32, uint8ToSint32, sint8ToSint32, uint16ToSint32, sint16ToSint32, uint32ToSint32, sint32ToSint32, uint64ToSint32, sint64ToSint32, singleToSint32, doubleToSint32, }, { boolToUint64, uint8ToUint64, sint8ToUint64, uint16ToUint64, sint16ToUint64, uint32ToUint64, sint32ToUint64, uint64ToUint64, sint64ToUint64, singleToUint64, doubleToUint64, }, { boolToSint64, uint8ToSint64, sint8ToSint64, uint16ToSint64, sint16ToSint64, uint32ToSint64, sint32ToSint64, uint64ToSint64, sint64ToSint64, singleToSint64, doubleToSint64, }, { boolToSingle, uint8ToSingle, sint8ToSingle, uint16ToSingle, sint16ToSingle, uint32ToSingle, sint32ToSingle, uint64ToSingle, sint64ToSingle, singleToSingle, doubleToSingle, }, { boolToDouble, uint8ToDouble, sint8ToDouble, uint16ToDouble, sint16ToDouble, uint32ToDouble, sint32ToDouble, uint64ToDouble, sint64ToDouble, singleToDouble, doubleToDouble, }, }; 0707010000002D000041ED00000000000000000000000265BCF78700000000000000000000000000000000000000000000002500000000pdcom-3.0.11.0.gfcbffda/src/msrproto0707010000002E000081A400000000000000000000000165BCF78700000435000000000000000000000000000000000000003100000000pdcom-3.0.11.0.gfcbffda/src/msrproto/Makefile.am#----------------------------------------------------------------------------- # # $Id$ # # Copyright (C) 2009 Richard Hacker <lerich@gmx.net> # Florian Pose <fp@igh-essen.com> # # This file is part of the PdCom library. # # The PdCom library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # The PdCom library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. # #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- 0707010000002F000081A400000000000000000000000165BCF78700003E20000000000000000000000000000000000000003400000000pdcom-3.0.11.0.gfcbffda/src/msrproto/MsrChannel.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include <string.h> // memcpy() #include "pdcom/Exception.h" #include "MsrChannel.h" #include "MsrProtocolHandler.h" #include <algorithm> // min() #include <sstream> // time parsing using namespace MSRProto; #define DEBUG 0 #define DEBUG_BASE64 0 #if DEBUG || DEBUG_BASE64 #include <iostream> #include <iomanip> using std::cout; using std::cerr; using std::endl; using std::hex; using std::setfill; using std::setw; #endif /****************************************************************************/ unsigned int euclid_gcd( unsigned int a, unsigned int b) /* From http://www.nist.gov/dads/HTML/euclidalgo.html */ { if (b) return euclid_gcd(b, a % b); else return a; } /****************************************************************************/ unsigned int binary_gcd(unsigned int u, unsigned int v) /* from http://en.wikipedia.org/wiki/Binary_GCD_algorithm */ { int shift; /* GCD(0,x) := x */ if (u == 0 || v == 0) return u | v; /* Let shift := lg K, where K is the greatest power of 2 * dividing both u and v. */ for (shift = 0; ((u | v) & 1) == 0; ++shift) { u >>= 1; v >>= 1; } while ((u & 1) == 0) u >>= 1; /* From here on, u is always odd. */ do { while ((v & 1) == 0) /* Loop X */ v >>= 1; /* Now u and v are both odd, so diff(u, v) is even. * Let u = min(u, v), v = diff(u, v)/2. */ if (u <= v) { v -= u; } else { int diff = u - v; u = v; v = diff; } v >>= 1; } while (v != 0); return u << shift; } /****************************************************************************/ int ext_euklid_gcd(int a, int b, int& x, int& y) /* From http://www.tekpool.com/?p=56 * ax + by = GCD(a,b) * Search for: Greatest Common Divisor */ { int prevX, prevY; int gcd; if(b > a) { return ext_euklid_gcd(b,a,y,x); } if(b == 0) { x=1; y=0; return a; } gcd = ext_euklid_gcd(b, a%b, prevX, prevY); x = prevY; y = prevX - int(a/b) * prevY; return gcd; } /****************************************************************************/ unsigned char Channel::base64ToChr[256] = {0,}; /****************************************************************************/ Channel::Channel( ProtocolHandler *protocolHandler, std::ostream* os, const char *name, const char *alias, unsigned int index, unsigned int rnum, unsigned int cnum, const char *orientation, const char *datatype, unsigned int datasize, unsigned int bufsize, double freq, const char *unit): Variable(protocolHandler, os, name, alias, index, rnum, cnum, orientation, datatype, datasize, 1.0 / freq, ""), msr_channel_bufsize(bufsize) { #if DEBUG cerr << freq << " " << samplePeriod << " " << path << endl; #endif reduction = 0; receiveCount = 0; eventTransmission = false; eventChannels = msrHandler->hasFeature("eventchannels"); pollActive = false; // Use base64ToChr[0] to indicate whether the character map is // initialised. if (!base64ToChr[0]) { unsigned char base64chr[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; // Generate character map to convert from base64 to integers memset(base64ToChr, 0, sizeof(base64ToChr)); for (unsigned char i = 0; base64chr[i]; i++) base64ToChr[base64chr[i]] = i; base64ToChr[(unsigned char)'-'] = 62; base64ToChr[(unsigned char)'_'] = 63; base64ToChr[0] = 1; } } /****************************************************************************/ Channel::~Channel() { if (eventTransmission or decimations.size()) { eventTransmission = false; decimations.clear(); updateTransmission(); } } /****************************************************************************/ unsigned int Channel::addTransmissionInterval(double interval) { if (interval and interval < samplePeriod) { std::stringstream err; err << "Subscription interval too small (interval=" << interval << ", samplePeriod=" << samplePeriod << ")!"; throw PdCom::VariableException(err.str()); } unsigned int requestedDecimation = (unsigned int) (interval / samplePeriod + 0.5); #if DEBUG cout << __func__ << "() " << interval << endl; #endif // ts >= 0 here, since we are registering streamed variables if (decimations.size() or eventTransmission) { // The stream is already active // Check that stream and event based transmissions are not mixed if (!(requestedDecimation xor eventTransmission)) { // Cannot mix event and stream transmission in MSR throw PdCom::VariableException("MSR Protocol does not support " "event and stream based transmission of a Channel " "simultaneously."); } if (!requestedDecimation) { // Event transmission has already been requested from MSR return requestedDecimation; } } // eventTransmission == true or requestedDecimation > 0 if (requestedDecimation) { // stream-based transmission requested if (decimations.find(requestedDecimation) == decimations.end()) { // This decimation does not exist, so need to register a new one decimations.insert(requestedDecimation); maxDecimation = *std::max_element(decimations.begin(), decimations.end()); updateTransmission(); } } else { // event-based transmission requested if (!eventChannels) { throw PdCom::VariableException( "Error trying to register event type subscription: " "Process does not support \"event\" feature."); } // Activate event transmission eventTransmission = true; updateTransmission(); } return requestedDecimation; } /****************************************************************************/ void Channel::rmTransmissionDecimation(int decimation) { #if DEBUG cout << __func__ << "() " << decimation << endl; #endif if (decimation < 0) { // Polled variables don't require further notice pollActive = false; return; } else if (eventTransmission) { eventTransmission = false; } else { // Subscription was deleted decimations.erase(decimation); } updateTransmission(); } /****************************************************************************/ void Channel::pollVariable() { #if DEBUG cerr << "Channel::" << __func__ << "() " << " " << eventTransmission << endl; #endif if (!pollActive) { *os << "<rk index=\"" << index << "\" />\n"; pollActive = true; } } /****************************************************************************/ void Channel::updateTransmission() { #if DEBUG cerr << "Channel::updateTransmission() " << pollActive << " " << eventTransmission << endl; #endif if (eventTransmission) { // Activate event transmission *os << "<xsad channels=\"" << index << "\" event=\"1" << "\" coding=\"" << "Base64" << "\" />\n"; return; } else if (decimations.empty()) { *os << "<xsod channels=\"" << index << "\" />\n"; reduction = 0; return; } // Find a reduction that is common to all decimations, i.e. // greatest common divisor unsigned int oldReduction = reduction; reduction = 0; for (Decimations::iterator it = decimations.begin(); it != decimations.end(); it++) { reduction = binary_gcd(reduction, *it); if (reduction == 1) break; } // reduction cannot be larger than msr_channel_bufsize reduction = std::min(reduction, msr_channel_bufsize); // Return if nothing has changed if (oldReduction and oldReduction == reduction) { #if DEBUG cerr << "transmission update unnecessary." << endl; #endif return; } // Calculate a blocksize such that the transmission is 25 Hz, // keeping in mind not to exceed the variable's block size in the buddy blocksize = int(1.0 / double(samplePeriod) / reduction / 25.0); blocksize = std::min(msr_channel_bufsize / reduction, blocksize); if (!blocksize) blocksize = 1; *os << "<xsad channels=\"" << index << "\" reduction=\"" << reduction << "\" blocksize=\"" << blocksize << "\" coding=\"" << "Base64" << "\" />\n"; receiveCount = 0; #if DEBUG cerr << "updating transmission: reduction: " << reduction << " blocksize: " << blocksize << endl; #endif } /****************************************************************************/ void Channel::newValues(const std::string& asc_time, const char *buf) { PdCom::Time dt(samplePeriod * double(reduction)); PdCom::Time timeOfLast, diffToFirst; std::stringstream str; double t; unsigned int decodedSize = calcBase64DecodedSize(buf); unsigned int numValues = decodedSize / memSize; if (decodedSize != numValues * memSize) { throw PdCom::VariableException("Invalid Base64 string received."); } str.imbue(std::locale("C")); // use '.' as a decimal separator! str << asc_time; str >> t; /* Important: asc_time is the time of the *last* value in the block! */ timeOfLast = t; diffToFirst = (numValues - 1) * (double) dt; /* mtime is defined in class Variable */ mtime = timeOfLast - diffToFirst; #if DEBUG cerr << __func__ << "() processing values. mtime=" << mtime.str() << " bufsize=" << strlen(buf) << " values=" << numValues << " t=" << std::fixed << t << " buf=" << buf << endl; #endif initBase64Src(buf); while (numValues--) { readBase64Value(); // Notify receiveCount += reduction; #if DEBUG cerr << "mtime=" << mtime.str() << " receiveCount=" << receiveCount << endl; #endif for (Decimations::iterator it = decimations.begin(); it != decimations.end(); it++) { if (receiveCount % *it) continue; #if DEBUG cerr << "notifying " << *it << endl; #endif notifySubscribers(*it); } mtime += dt; if (receiveCount >= maxDecimation) { receiveCount = 0; } } } /****************************************************************************/ void Channel::newEvent(const std::string &asc_time, const char *buf) { std::stringstream str; double t; #if DEBUG cerr << "newEvent() for index " << index << endl; #endif str.imbue(std::locale("C")); // use '.' as a decimal separator! str << asc_time; str >> t; mtime = t; if (calcBase64DecodedSize(buf) == memSize) { initBase64Src(buf); readBase64Value(); // Notify notifySubscribers(0); } } /****************************************************************************/ void Channel::newPoll(const char *buf) { double value[elementCount]; std::stringstream str; char sep; #if DEBUG cerr << "Processing newPoll (" << elementCount << " values): " << buf << " "; #endif str.imbue(std::locale("C")); // use '.' as a decimal separator! str << buf; for (size_t i = 0; i < elementCount; i++) { if (i) str >> sep; str >> value[i]; } #if DEBUG cerr << endl; #endif Variable::pushValue(value, elementCount); notifyPoll(); pollActive = false; } /****************************************************************************/ void Channel::initBase64Src(const char *src) { base64Str = src; base64ChrPos = 0; base64Value = 0; // FIXME unused variable, kept for binary compatibility } /****************************************************************************/ bool Channel::readBase64Value() { unsigned int bufPos = 0; const unsigned char *p = (unsigned char *) base64Str; #if DEBUG_BASE64 cerr << __func__ << " " << base64Str << " memSize=" << memSize << endl; #endif do { #if DEBUG_BASE64 cerr << "base64ChrPos " << base64ChrPos << " diff=" << (size_t) ((const char *) p - (const char *) base64Str) << " transpose_skip=" << transpose_skip << " bufPos=" << bufPos << " memSize=" << memSize << endl; #endif switch (base64ChrPos++) { case 0: dataPtr[bufPos++] = (base64ToChr[*p] << 2) | (base64ToChr[*(p + 1)] >> 4); p++; break; case 1: dataPtr[bufPos++] = (base64ToChr[*p] << 4) | (base64ToChr[*(p + 1)] >> 2); p++; break; case 2: dataPtr[bufPos++] = (base64ToChr[*p] << 6) | (base64ToChr[*(p + 1)]); p += 2; base64ChrPos = 0; break; default: break; } #if DEBUG_BASE64 { unsigned int i; cerr << "output from decode:" << hex; for (i = 0; i < memSize; i++) cerr << " " << setfill ('0') << setw(2) << (unsigned int) ((const uint8_t *) dataPtr)[i]; cerr << endl; } #endif if (transpose_skip) { if (!(bufPos % datawidth)) { bufPos += transpose_skip * datawidth; } if (bufPos == memSize + transpose_skip * datawidth) { bufPos = 0; } else if (bufPos >= memSize) { bufPos -= memSize - datawidth; } } else if (bufPos >= memSize) { bufPos = 0; } } while (bufPos); base64Str = (char *) p; return true; } /****************************************************************************/ unsigned int Channel::calcBase64DecodedSize(const char *buf) const { unsigned int len = strlen(buf); /* length must be greater zero and multiple of 4 */ if (!len or len & 0x03) { throw PdCom::VariableException("Invalid Base64 string."); } return len / 4 * 3 - (buf[len - 1] == '=') - (buf[len - 2] == '='); } /****************************************************************************/ 07070100000030000081A400000000000000000000000165BCF78700000CD7000000000000000000000000000000000000003200000000pdcom-3.0.11.0.gfcbffda/src/msrproto/MsrChannel.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef MSRCHANNEL_H #define MSRCHANNEL_H #include "MsrVariable.h" #include "pdcom/Exception.h" #include <set> #include <string> namespace MSRProto { /****************************************************************************/ /** MSR channel. * \todo doc */ class Channel: public Variable { public: Channel( ProtocolHandler *protocolhandler, std::ostream* os, const char *name, const char *alias, unsigned int index, unsigned int rnum, unsigned int cnum, const char *orientation, const char *datatype, unsigned int datasize, unsigned int bufsize, double freq, const char *unit); ~Channel(); void newValues(const std::string& t, const char *buf); void newEvent(const std::string& t, const char *buf); void newPoll(const char *buf); private: // The buffer size as reported by <rk> const unsigned int msr_channel_bufsize; unsigned int reduction; // If reduction == 0, use event transmission unsigned int blocksize; // Blocksize of transmission // True if MSR Server supports event based transmission bool eventChannels; // Set if the MSR Server is sending the channel as event bool eventTransmission; unsigned int receiveCount; bool pollActive; typedef std::set<unsigned int> Decimations; Decimations decimations; Decimations::value_type maxDecimation; // Here are the methods reimplemented from base class unsigned int addTransmissionInterval(double interval); void rmTransmissionDecimation(int decimation); void updateTransmission(); void pollVariable(); void initBase64Src(const char* src); bool readBase64Value(); unsigned int calcBase64DecodedSize(const char *) const; const char* base64Str; unsigned int base64ChrPos; /* Pos in binary output stream; 0..2 */ unsigned char base64Value; static unsigned char base64ToChr[]; }; } // namespace MSRProto #endif // MSRCHANNEL_H 07070100000031000081A400000000000000000000000165BCF78700000805000000000000000000000000000000000000003400000000pdcom-3.0.11.0.gfcbffda/src/msrproto/MsrException.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef MSRCOMEXCEPT_H #define MSRCOMEXCEPT_H #include "pdcom/Exception.h" #include <string> namespace MSRProto { /****************************************************************************/ /** Exception class. */ class Exception: public PdCom::Exception { public: /** Constructor with std::string parameter. */ Exception( const std::string &s /**< Message. */): PdCom::Exception(s) {} /** Constructor with std::ostringstream parameter. */ Exception( const std::string &var, const std::ostringstream &s /**< Message. */ ): PdCom::Exception( std::string(var).append(": ").append(s.str())) {} /** Constructor with const char pointer parameter. */ Exception( const char *s /**< message. */ ): PdCom::Exception(s) {} }; } // namespace MSRProto #endif // MSRCOMEXCEPT_H /****************************************************************************/ 07070100000032000081A400000000000000000000000165BCF78700001E0F000000000000000000000000000000000000003200000000pdcom-3.0.11.0.gfcbffda/src/msrproto/MsrParam.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include "pdcom/Exception.h" #include "MsrParam.h" #include "MsrProtocolHandler.h" #include <cstdlib> #include <sstream> using namespace MSRProto; #define DEBUG 0 #if DEBUG #include <iostream> #endif const char *Param::hexvalues[] = { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1A", "1B", "1C", "1D", "1E", "1F", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2A", "2B", "2C", "2D", "2E", "2F", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3A", "3B", "3C", "3D", "3E", "3F", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4A", "4B", "4C", "4D", "4E", "4F", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5A", "5B", "5C", "5D", "5E", "5F", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", "7B", "7C", "7D", "7E", "7F", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8A", "8B", "8C", "8D", "8E", "8F", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9A", "9B", "9C", "9D", "9E", "9F", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA", "AB", "AC", "AD", "AE", "AF", "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "BA", "BB", "BC", "BD", "BE", "BF", "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "CA", "CB", "CC", "CD", "CE", "CF", "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "DA", "DB", "DC", "DD", "DE", "DF", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "EA", "EB", "EC", "ED", "EE", "EF", "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF", }; /****************************************************************************/ Param::Param( ProtocolHandler *protocolhandler, std::ostream* os, const char *name, unsigned int index, unsigned int rnum, unsigned int cnum, const char *orientation, unsigned int msr_flags, unsigned int datasize, const char *unit, const char *datatype): Variable(protocolhandler, os, name, "", index, rnum, cnum, orientation, datatype, datasize, 0.0, "") { writeable = true; requestActive = false; pollActive = false; subscribed = false; binparameters = msrHandler->hasFeature("binparameters"); pushparameters = msrHandler->hasFeature("pushparameters"); pmtime = msrHandler->hasFeature("pmtime"); allocateMemory(); } /****************************************************************************/ Param::~Param() { } /****************************************************************************/ void Param::valueChanged(const char *src, size_t len) { #if DEBUG std::cerr << "Set value for parameter " << index << "." << std::endl; #endif if (binparameters) { #if DEBUG std::cerr << "binparameters." << std::endl; #endif unsigned char* end = (unsigned char *) dataPtr + memSize; *os << "<wp index=\"" << index << "\" hexvalue=\""; for (unsigned char* p = (unsigned char *) dataPtr; p != end; p++) { *os << hexvalues[*p]; } *os << "\" />\n"; } else { #if DEBUG std::cerr << "no binparameters." << std::endl; #endif double value[elementCount]; getValue(value, elementCount); *os << "<wp index=\"" << index << "\" value=\""; for (size_t i = 0; i < elementCount; i++) { *os << value[i]; } *os << "\" />\n"; } os->flush(); } /****************************************************************************/ void Param::newValues(const char *asc_time, const char *buf) { double value[elementCount]; char delim; unsigned int bufPos = 0; #if DEBUG std::cerr << "New values for parameter " << index << ": " << buf << std::endl; #endif std::stringstream str; str.imbue(std::locale("C")); // use '.' as a decimal separator! str << buf; do { str >> value[bufPos]; #if DEBUG std::cerr << "value[" << bufPos << "]=" << value[bufPos] << std::endl; #endif bufPos++; str >> delim; if (transpose_skip) { bufPos += transpose_skip; if (bufPos == elementCount + transpose_skip) { bufPos = 0; } else if (bufPos >= elementCount) { bufPos -= elementCount - 1; } } else if (bufPos >= elementCount) { bufPos = 0; } } while (bufPos); pushValue(value, elementCount); if (asc_time && pmtime) { std::stringstream str; double t; str.imbue(std::locale("C")); // use '.' as a decimal separator! str << asc_time; str >> t; mtime = t; } if (subscribed) { notifySubscribers(0); } if (pollActive) { notifyPoll(); pollActive = false; } requestActive = false; } /****************************************************************************/ unsigned int Param::addTransmissionInterval(double interval) { if (interval) { throw PdCom::VariableException("Variable is only available as event"); } if (!pushparameters) { throw PdCom::VariableException( "MSR Protocol does not have \"pushparameters\" feature."); } subscribed = true; requestParameter(); return 0; } /****************************************************************************/ void Param::rmTransmissionDecimation(int decimation) { subscribed = false; } /****************************************************************************/ void Param::parameterUpdate() { #if DEBUG std::cerr << "Parameter " << index << " update." << std::endl; #endif if (subscribed) { requestParameter(); } } /****************************************************************************/ void Param::pollVariable() { requestParameter(); pollActive = true; } /****************************************************************************/ void Param::requestParameter() { #if DEBUG std::cerr << "Requesting parameter " << index << "." << std::endl; #endif if (!requestActive) { requestActive = true; *os << "<rp index=\"" << index << "\" />\n"; } } /****************************************************************************/ 07070100000033000081A400000000000000000000000165BCF78700000AB1000000000000000000000000000000000000003000000000pdcom-3.0.11.0.gfcbffda/src/msrproto/MsrParam.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef MSRPARAM_H #define MSRPARAM_H #include "MsrVariable.h" #include "pdcom/Exception.h" #include <list> #include <set> namespace MSRProto { class ProtocolHandler; /****************************************************************************/ /** MSR parameter. */ class Param: public Variable { friend class ProtocolHandler; public: Param( ProtocolHandler *protocolhandler, std::ostream *os, const char *name, unsigned int index, unsigned int rnum, unsigned int cnum, const char *orientation, unsigned int flags, unsigned int datasize, const char *unit, const char *datatype); ~Param(); private: void requestParameter(); bool pollActive; bool requestActive; bool subscribed; /** New parameter values. * * Called by MSR Parser when parameter data has arrived * */ void newValues(const char *t, const char *buf); /** Signal from the MSR process that the parameter has changed */ void parameterUpdate(); static const char *hexvalues[]; bool binparameters; bool pushparameters; bool pmtime; /* Reimplemented from baseclass */ unsigned int addTransmissionInterval(double interval); void rmTransmissionDecimation(int decimation); void pollVariable(); void valueChanged(const char* src, size_t n); }; } // namespace MSRProto #endif // MSRPARAM_H /****************************************************************************/ 07070100000034000081A400000000000000000000000165BCF78700007FB4000000000000000000000000000000000000003C00000000pdcom-3.0.11.0.gfcbffda/src/msrproto/MsrProtocolHandler.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include <string.h> // memcpy() etc. #include "MsrProtocolHandler.h" #include "MsrException.h" #include "MsrParam.h" #include "MsrChannel.h" #include "pdcom/Exception.h" #include "pdcom/Process.h" #include <cstdlib> #include <algorithm> #include <vector> #include <sstream> //#define DEBUG_XML //#define DEBUG_STATEMACHINE #define DEBUG 0 #if DEBUG #include <iostream> using std::cout; using std::cerr; using std::endl; #endif using namespace MSRProto; /****************************************************************************/ PdCom::ProtocolHandler* ProtocolHandler::tryParse( const char *buf, size_t len, PdCom::Process* process, std::ostream* os) { if (memcmp("<connected", buf, std::min(size_t(10), len))) { process->protocolLog(PdCom::Process::LogDebug, "MSR Protocol handler does not recognise the protocol."); return NULL; } else { process->protocolLog(PdCom::Process::LogInfo, "MSR Protocol handler recognises the protocol."); return new ProtocolHandler(process, os); } } /****************************************************************************/ ProtocolHandler::ProtocolHandler( PdCom::Process *process, std::ostream *os ): PdCom::ProtocolHandler(process, os) { state = NotConnected; connected_state = Idle; xmlDepth = 0; admin = write = 0; maxParamIdx = maxChannelIdx = 0; if (!(xmlParser = XML_ParserCreate(NULL))) throw PdCom::ProtocolException("Could not create XML parser"); XML_SetUserData(xmlParser, this); XML_SetElementHandler(xmlParser, ExpatInitStartTag, ExpatInitEndTag); parse("<xml>", 5); } /****************************************************************************/ ProtocolHandler::~ProtocolHandler() { #if DEBUG cerr << "deleting MSR ProtocolHandler" << endl; #endif XML_ParserFree(xmlParser); for (std::vector<Param*>::iterator it = parameter.begin(); it != parameter.end(); it++) delete (*it); for (std::vector<Channel*>::iterator it = channel.begin(); it != channel.end(); it++) delete (*it); } /****************************************************************************/ std::map<std::string,std::string> ProtocolHandler::getInfo() const { std::map<std::string,std::string> i; i["protocol"] = "MSR"; i["features"] = featureStr; i["app"] = app; i["appversion"] = appVersion; std::stringstream str; str << version; i["version"] = str.str(); return i; } /****************************************************************************/ bool ProtocolHandler::hasFeature(const std::string &f) const { return feature.find(f) != feature.end(); } /****************************************************************************/ size_t ProtocolHandler::parse(const char *buf, size_t len) { #if DEBUG cout << "==================================" << endl << std::string(buf,len) << endl << "===================================" << endl; #endif if (XML_STATUS_OK != XML_Parse(xmlParser, buf, len, 0)) { throw PdCom::ProtocolException( std::string("Fatal XML parsing error: ") + XML_ErrorString(XML_GetErrorCode(xmlParser)) ); } return len; } /****************************************************************************/ void ProtocolHandler::sendBroadcast( const std::string &message, const std::string &attr ) { for (std::string::const_iterator it = attr.begin(); it != attr.end(); it++) { if (!std::isalpha(*it)) { process->protocolLog(PdCom::Process::LogError, __func__ + std::string("(): Invalid attribute ") + attr); return; } } *os << "<broadcast " << attr << "=\"" << xmlEscape(message) << "\"/>\n"; os->flush(); } /**************************************************************************** * Wrapper to get from static function calls to class method calls */ void XMLCALL ProtocolHandler::ExpatInitStartTag(void *data, const char *el, const char **attr) { reinterpret_cast<ProtocolHandler*>(data)->initStartTag(el, attr); } /**************************************************************************** * Wrapper to get from static function calls to class method calls */ void XMLCALL ProtocolHandler::ExpatInitEndTag(void *data, const char *el) { reinterpret_cast<ProtocolHandler*>(data)->initEndTag(el); } /****************************************************************************/ void ProtocolHandler::processInfoTag(const char **attr) { double time = 0; const char* msg = 0; for (int i = 0; attr[i]; i += 2) { if (!strcmp(attr[i], "text")) { if (!admin and !strncmp(attr[i+1], "Adminmode", 9)) { admin = 1; } else if (!write and !strncmp(attr[i+1], "write access", 12)) { write = 1; } msg = attr[i + 1]; } else if (!strcmp(attr[i], "time")) { std::stringstream str; str.imbue(std::locale("C")); // use '.' as a decimal separator! str << attr[i + 1]; str >> time; } } if (msg) { process->processMessage(time, PdCom::Process::LogInfo, 0, msg); } } /****************************************************************************/ void ProtocolHandler::processBroadcastTag(const char **attr) { double time = 0; const char* msg = 0; for (int i = 0; attr[i]; i += 2) { if (!strcmp(attr[i], "text")) { msg = attr[i + 1]; } else if (!strcmp(attr[i], "time")) { std::stringstream str; str.imbue(std::locale("C")); // use '.' as a decimal separator! str << attr[i + 1]; str >> time; } } if (msg) { process->processMessage(time, PdCom::Process::LogInfo, 0, msg); } } /****************************************************************************/ void ProtocolHandler::initStartTag(const char *el, const char **attr) { #ifdef DEBUG_XML #ifdef DEBUG_STATEMACHINE cerr << "---------- start tag <" << el << "> "; switch (state) { case NotConnected: cerr << "State: NotConnected"; break; case Connected: cerr << "State: Connected"; break; case ReadParam: cerr << "State: ReadParam"; break; case ReadParamList: cerr << "State: ReadParamList"; break; case ReadChan: cerr << "State: ReadChan"; break; case ReadChanList: cerr << "State: ReadChanList"; break; } cerr << " Depth " << xmlDepth << endl; #endif // DEBUG_STATEMACHINE cerr << "Attributes:" << endl; for (int i = 0; attr[i]; i += 2) { cerr << " " << attr[i] << " = " << attr[i+1] << endl; } #endif // DEBUG_XML switch (xmlDepth) { case 0: process->protocolLog(PdCom::Process::LogInfo, "Waiting for <connected> tag."); break; case 1: if (!strcmp(el, "info")) { processInfoTag(attr); break; } else if (!strcmp(el, "broadcast")) { processBroadcastTag(attr); break; } switch (state) { case NotConnected: if (!strcmp(el, "connected")) { state = Connected; process->protocolLog(PdCom::Process::LogInfo, "<connected> tag arrived."); for (int i = 0; attr[i]; i += 2) { if (!strcmp(attr[i], "name")) { name = attr[i+1]; } else if (!strcmp(attr[i], "host")) { host = attr[i+1]; } else if (!strcmp(attr[i], "app")) { app = attr[i+1]; } else if (!strcmp(attr[i], "appversion")) { appVersion = attr[i+1]; } else if (!strcmp(attr[i], "version")) { version = atoi(attr[i+1]); } else if (!strcmp(attr[i], "features")) { const char *c = attr[i+1]; const char *c1; featureStr = c; /* Parse comma separated features */ while (*c) { unsigned int len; if (',' == *c) { /* Ignore commas */ c++; continue; } /* Find next ',' */ c1 = strchr(c, ','); /* If no comma is found, c1 is NULL. */ if (c1) { /* c1 points to a comma, so calculate * len and increment c1 */ len = c1++ - c; } else { /* No comma found, so get length from * strlen() and let c1 point to the * end */ len = strlen(c); c1 = c + len; } feature.insert(std::string(c, len)); c = c1; } } else if (!strcmp(attr[i], "recievebufsize")) { recievebufsize = atoi(attr[i+1]); } } } break; case Connected: break; case ReadParam: if (!strcmp(el, "parameters")) { state = ReadParamList; } break; case ReadChan: if (!strcmp(el, "channels")) { state = ReadChanList; } break; default: break; } break; case 2: switch (state) { case ReadParamList: if (!strcmp(el, "parameter")) { const char* name = 0; unsigned int index = 0; unsigned int rnum = 1; unsigned int cnum = 1; const char* orientation = 0; unsigned int flags = 0; unsigned int datasize = 0; const char* unit = 0; const char* datatype = 0; for (int i = 0; attr[i]; i += 2) { if (!strcmp(attr[i], "name")) { name = attr[i+1]; } else if (!strcmp(attr[i], "index")) { index = atoi(attr[i+1]); } else if (!strcmp(attr[i], "flags")) { flags = atoi(attr[i+1]); } else if (!strcmp(attr[i], "rnum")) { rnum = atoi(attr[i+1]); } else if (!strcmp(attr[i], "cnum")) { cnum = atoi(attr[i+1]); } else if (!strcmp(attr[i], "datasize")) { datasize = atoi(attr[i+1]); } else if (!strcmp(attr[i], "orientation")) { orientation = attr[i+1]; } else if (!strcmp(attr[i], "typ")) { datatype = attr[i+1]; } else if (!strcmp(attr[i], "unit")) { unit = attr[i+1]; } } if (index >= maxParamIdx) { maxParamIdx = index + 1; parameter.resize(maxParamIdx); } try { parameter[index] = new Param( this, os, name, index, rnum, cnum, orientation, flags, datasize, unit, datatype); process->protocolLog(PdCom::Process::LogDebug, std::string("Found Parameter: ") + name); } catch (MSRProto::Exception &e) { process->protocolLog(PdCom::Process::LogError, std::string("Failed to create MsrParam ") + name + ": " + e.what()); parameter[index] = 0; } } break; case ReadChanList: if (!strcmp(el, "channel")) { const char* name = 0; const char* alias = ""; unsigned int index = 0; unsigned int rnum = 1; unsigned int cnum = 1; const char* orientation = "SCALAR"; const char* datatype = 0; unsigned int datasize = 0; unsigned int bufsize = 0; unsigned int freq = 0; const char* unit = ""; for (int i = 0; attr[i]; i += 2) { if (!strcmp(attr[i], "name")) { name = attr[i+1]; } else if (!strcmp(attr[i], "alias")) { alias = attr[i+1]; } else if (!strcmp(attr[i], "index")) { index = atoi(attr[i+1]); } else if (!strcmp(attr[i], "rnum")) { rnum = atoi(attr[i+1]); } else if (!strcmp(attr[i], "cnum")) { cnum = atoi(attr[i+1]); } else if (!strcmp(attr[i], "orientation")) { orientation = attr[i+1]; } else if (!strcmp(attr[i], "typ")) { datatype = attr[i+1]; } else if (!strcmp(attr[i], "datasize")) { datasize = atoi(attr[i+1]); } else if (!strcmp(attr[i], "bufsize")) { bufsize = atoi(attr[i+1]); } else if (!strcmp(attr[i], "HZ")) { freq = atoi(attr[i+1]); } else if (!strcmp(attr[i], "unit")) { unit = attr[i+1]; } } if (index >= maxChannelIdx) { maxChannelIdx = index + 1; channel.resize(maxChannelIdx); } try { channel[index] = new Channel( this, os, name, alias, index, rnum, cnum, orientation, datatype, datasize, bufsize, freq, unit); process->protocolLog(PdCom::Process::LogDebug, std::string("Found Channel: ") + name); } catch (MSRProto::Exception &e) { process->protocolLog(PdCom::Process::LogError, std::string("Failed to create MsrChan ") + name + ": " + e.what()); channel[index] = 0; } } break; default: break; } break; default: break; } xmlDepth++; } /****************************************************************************/ void ProtocolHandler::initEndTag(const char *el) { xmlDepth--; #ifdef DEBUG_STATEMACHINE cerr << "========== end tag <" << el << "> "; switch (state) { case NotConnected: cerr << "State: NotConnected"; break; case Connected: cerr << "State: Connected"; break; case ReadParam: cerr << "State: ReadParam"; break; case ReadParamList: cerr << "State: ReadParamList"; break; case ReadChan: cerr << "State: ReadChan"; break; case ReadChanList: cerr << "State: ReadChanList"; break; } cerr << " Depth " << xmlDepth << endl; #endif // DEBUG_STATEMACHINE switch (xmlDepth) { case 0: break; case 1: switch (state) { case Connected: if (!strcmp(el, "connected")) { login(); sendParameterList(); state = ReadParam; } break; case ReadParamList: if (!strcmp(el, "parameters")) { std::ostringstream msg; msg << "Found " << maxParamIdx << " parameters."; process->protocolLog(PdCom::Process::LogInfo, msg.str()); sendChannelList(); state = ReadChan; } break; case ReadChanList: if (!strcmp(el, "channels")) { state = Ready; std::ostringstream msg; msg << "Found " << maxChannelIdx << " channels."; process->protocolLog(PdCom::Process::LogInfo, msg.str()); XML_SetElementHandler(xmlParser, ExpatConnectedStartTag, ExpatConnectedEndTag); // Tell the process that communication is ready process->protocolLog(PdCom::Process::LogInfo, "Protocol initialisation finished."); initialised(); } break; default: break; } break; case 2: switch (state) { default: break; } default: break; } } /**************************************************************************** * Wrapper to get from static function calls to class method calls */ void XMLCALL ProtocolHandler::ExpatConnectedStartTag(void *data, const char *el, const char **attr) { reinterpret_cast<ProtocolHandler*>(data)->connectedStartTag(el, attr); } /**************************************************************************** * Wrapper to get from static function calls to class method calls */ void XMLCALL ProtocolHandler::ExpatConnectedEndTag(void *data, const char *el) { reinterpret_cast<ProtocolHandler*>(data)->connectedEndTag(el); } /****************************************************************************/ void ProtocolHandler::connectedStartTag(const char *el, const char **attr) { #ifdef DEBUG_XML #ifdef DEBUG_STATEMACHINE cerr << "---------- start tag <" << el << "> "; switch (state) { case NotConnected: cerr << "State: NotConnected"; break; case Connected: cerr << "State: Connected"; break; case ReadParam: cerr << "State: ReadParam"; break; case ReadParamList: cerr << "State: ReadParamList"; break; case ReadChan: cerr << "State: ReadChan"; break; case ReadChanList: cerr << "State: ReadChanList"; break; } cerr << " Depth " << xmlDepth << endl; #endif // DEBUG_STATEMACHINE cerr << "Attributes:" << endl; for (int i = 0; attr[i]; i += 2) { cerr << " " << attr[i] << " = " << attr[i + 1] << endl; } #endif // DEBUG_XML switch (xmlDepth) { unsigned int i; case 1: switch (connected_state) { case Idle: if (!strcmp(el, "data")) { for (i = 0; attr[i]; i += 2) { if (!strcmp(attr[i], "time")) { // this is the time of the last value in the // following tags! dataTime = attr[i + 1]; } } connected_state = ReadData; } else if (!strcmp(el, "pu")) { unsigned int param_update_idx = ~0U; // Parameter update for (i = 0; attr[i]; i += 2) { if (strcmp(attr[i], "index") == 0) { param_update_idx = atoi(attr[i + 1]); } } if (param_update_idx < maxParamIdx and parameter[param_update_idx]) { parameter[param_update_idx]->parameterUpdate(); } } else if (!strcmp(el, "parameter")) { const char* value = NULL; const char* mtime = NULL; unsigned int index = ~0U; for (i = 0; attr[i]; i += 2) { if (!strcmp(attr[i], "index")) { index = atoi(attr[i + 1]); } else if (!strcmp(attr[i], "mtime")) { mtime = attr[i + 1]; } else if (!strcmp(attr[i], "value")) { value = attr[i + 1]; } } if (index < maxParamIdx && value) { parameter[index]->newValues(mtime, value); } else { std::string msg( "Invalid response to " "parameter update request: "); if (!value) { msg += "No value was supplied."; } else { msg += "Array index exceeded."; } process->protocolLog(PdCom::Process::LogError, msg); } } else if (!strcmp(el, "channel")) { const char* value = NULL; unsigned int index = ~0U; for (i = 0; attr[i]; i += 2) { if (!strcmp(attr[i], "index")) { index = atoi(attr[i + 1]); } else if (!strcmp(attr[i], "value")) { value = attr[i + 1]; } } if (index < maxChannelIdx && value) { channel[index]->newPoll(value); } else { std::string msg( "Invalid response to channel poll " "request: "); if (!value) { msg += "No value was supplied."; } else { msg += "Array index exceeded."; } process->protocolLog(PdCom::Process::LogError, msg); } } else if (!strcmp(el, "info")) { processInfoTag(attr); } else if (!strcmp(el, "broadcast")) { processBroadcastTag(attr); } break; default: break; } break; case 2: switch (connected_state) { case ReadData: if (!strcmp(el, "F")) { unsigned int index = ~0U; const char *value = 0; for (i = 0; attr[i]; i += 2) { if (strcmp(attr[i], "c") == 0) { index = atoi(attr[i + 1]); } else if (strcmp(attr[i], "d") == 0) { value = attr[i + 1]; } } if (index <= maxChannelIdx && value) { channel[index]->newValues(dataTime, value); } } else if (!strcmp(el, "E")) { unsigned int index = ~0U; const char *value = 0; for (i = 0; attr[i]; i += 2) { if (strcmp(attr[i], "c") == 0) { index = atoi(attr[i + 1]); } else if (strcmp(attr[i], "d") == 0) { value = attr[i + 1]; } } if (index <= maxChannelIdx && value) { channel[index]->newEvent(dataTime, value); } } break; default: break; } break; default: break; } xmlDepth++; } /****************************************************************************/ void ProtocolHandler::connectedEndTag(const char *el) { xmlDepth--; #ifdef DEBUG_STATEMACHINE cerr << "========== end tag <" << el << "> "; switch (state) { case NotConnected: cerr << "State: NotConnected"; break; case Connected: cerr << "State: Connected"; break; case ReadParam: cerr << "State: ReadParam"; break; case ReadParamList: cerr << "State: ReadParamList"; break; case ReadChan: cerr << "State: ReadChan"; break; case ReadChanList: cerr << "State: ReadChanList"; break; } cerr << " Depth " << xmlDepth << endl; #endif // DEBUG_STATEMACHINE switch (xmlDepth) { case 0: break; case 1: switch (connected_state) { case ReadData: if (!strcmp(el, "data")) connected_state = Idle; break; default: break; } break; default: break; } } /****************************************************************************/ void ProtocolHandler::login() const { std::list<PdCom::Process::ClientInteraction> prompt; PdCom::Process::ClientInteraction ci; std::string loginStr; ci.prompt = "Username"; ci.response = "Username"; prompt.push_back(ci); ci.prompt = "Hostname"; ci.response = "Hostname"; prompt.push_back(ci); ci.prompt = "Application"; ci.response = "Application"; prompt.push_back(ci); if(!process->clientInteraction("MSR Client Authentication:", "MSR protocol would like to know the following: ", "", prompt)) return; loginStr += prompt.front().response; prompt.pop_front(); loginStr += "@"; loginStr += prompt.front().response; prompt.pop_front(); *os << "<remote_host name=\"" << xmlEscape(loginStr) << "\" applicationname=\"" << xmlEscape(prompt.front().response) << "\" access=\"allow\" isadmin=\"true\" />\n"; process->protocolLog(PdCom::Process::LogInfo, std::string( "Logging in as \"") + loginStr + "\""); } /****************************************************************************/ void ProtocolHandler::sendChannelList() const { *os << "<rk />\n"; process->protocolLog(PdCom::Process::LogInfo, "Requesting channel list."); } /****************************************************************************/ void ProtocolHandler::sendParameterList() const { *os << "<rp />\n"; process->protocolLog(PdCom::Process::LogInfo, "Requesting parameter list."); } /****************************************************************************/ std::string ProtocolHandler::xmlEscape(const std::string &str) { std::stringstream ret; for (std::string::const_iterator it = str.begin(); it != str.end(); it++) { switch (*it) { case '<': ret << "<"; break; case '>': ret << ">"; break; case '&': ret << "&"; break; case '"': ret << """; break; case '\'': ret << "'"; break; default: ret << *it; break; } } return ret.str(); } /****************************************************************************/ 07070100000035000081A400000000000000000000000165BCF78700001001000000000000000000000000000000000000003A00000000pdcom-3.0.11.0.gfcbffda/src/msrproto/MsrProtocolHandler.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef MSRPROTOCOLHANDLER_H #define MSRPROTOCOLHANDLER_H #include "../ProtocolHandler.h" #include "pdcom/Exception.h" #include <expat_external.h> #include <expat.h> #include <string> #include <set> #include <vector> #include <cstring> namespace MSRProto { class Param; class Channel; class Variable; /****************************************************************************/ /** MSR-specific protocol handler. */ class ProtocolHandler: public PdCom::ProtocolHandler { public: ProtocolHandler(PdCom::Process *process, std::ostream *os); ~ProtocolHandler(); /** Test whether MSR can parse the buffer * * \return Reference to new ProtocolHandler if successful */ static PdCom::ProtocolHandler* tryParse(const char *buf, size_t len, PdCom::Process *process, std::ostream *os); size_t parse(const char *buf, size_t len); bool connected() const { return state == Ready; } bool hasFeature(const std::string &feature) const; std::map<std::string,std::string> getInfo() const; void sendBroadcast(const std::string &, const std::string & = "text"); private: /* Properties of the server */ std::string name; std::string host; std::string app; std::string appVersion; unsigned int version; std::set<std::string> feature; unsigned int recievebufsize; std::vector<Param*> parameter; std::vector<Channel*> channel; unsigned int maxParamIdx; unsigned int maxChannelIdx; std::string featureStr; unsigned int admin; unsigned int write; enum ConnectionState { NotConnected, Connected, ReadParam, ReadParamList, ReadChan, ReadChanList, Ready }; ConnectionState state; enum ConnectedState { Idle, ReadData, }; ConnectedState connected_state; std::string dataTime; // time tag of <data time="..."> XML_Parser xmlParser; int xmlDepth; static void XMLCALL ExpatInitStartTag(void *, const char *, const char **); static void XMLCALL ExpatInitEndTag(void *, const char *); static void XMLCALL ExpatConnectedStartTag(void *, const char *, const char **); static void XMLCALL ExpatConnectedEndTag(void *, const char *); void initStartTag(const char *, const char **); void initEndTag(const char *); void connectedStartTag(const char *, const char **); void connectedEndTag(const char *); void processInfoTag(const char**); void processBroadcastTag(const char**); void login() const; void sendChannelList() const; void sendParameterList() const; static std::string xmlEscape(const std::string &); }; } // namespace PdCom #endif // MSRPROTOCOLHANDLER_H /****************************************************************************/ 07070100000036000081A400000000000000000000000165BCF78700001A24000000000000000000000000000000000000003500000000pdcom-3.0.11.0.gfcbffda/src/msrproto/MsrVariable.cpp/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #include "pdcom/Data.h" #include "MsrVariable.h" #include "MsrException.h" #include "MsrProtocolHandler.h" #include <cstring> #include <string> #define DEBUG 0 #if DEBUG #include <iostream> using std::cout; using std::cerr; using std::endl; #endif using namespace MSRProto; /****************************************************************************/ MSRProto::Variable::Variable( ProtocolHandler *msrHandler, std::ostream *os, const char *name, const char *alias, unsigned int index, unsigned int rnum, unsigned int cnum, const char *orientationString, const char *datatypeString, unsigned int protocolDatawidth, double sampleTime, const char *unit): PdCom::Variable( msrHandler->getProcess(), name, alias, genDataType(datatypeString), genDimension(datatypeString, orientationString, rnum, cnum), sampleTime), msrHandler(msrHandler), os(os), index(index), unit(unit), rnum(rnum), cnum(cnum), datawidth(Data::getTypeWidth(type)), transpose_skip(getTransposeSkip(orientationString, cnum)) { size_t dimensions = dimension.size(); size_t elementCount = dimension.getElementCount(); std::ostringstream errmsg; if (orientationString and strcmp(orientationString, "SCALAR")) { /* Orientation was supplied by the ProtocolHandler. * Check it for plausibility */ if (!strcmp(orientationString, "VECTOR")) { if (dimensions != 1 or elementCount < 2) { errmsg << "MSR Data Orientation 'VECTOR' " "is expected to have exactly one dimension; found " << dimensions << " dimensions with " << dimension.getElementCount() << " elements"; } } else if ((!strncmp(orientationString, "MATRIX_COL_MAJOR", 16) or !strcmp(orientationString, "MATRIX_ROW_MAJOR"))) { if (dimensions != 2) { errmsg << "MSR Data Orientation '" << orientationString << "' is expected to have 2 dimensions; found " << dimensions << " dimensions."; } else if (!strcmp(orientationString, "MATRIX_COL_MAJOR_ND") and !transpose_skip) { errmsg << "MSR Data Orientation '" << orientationString << "' is expected to have a transpose_skip > 0"; } } else { errmsg << "MSR Data Orientation '" << orientationString << "' is unknown."; } } else if (dimensions != 1 or elementCount != 1) { // Scalar; if (!orientationString) { errmsg << "MSR Data Orientation is not specified, " << "so a scalar is assumed."; } else { errmsg << "MSR Data Orientation 'SCALAR' is expected to have " "one dimension with one element."; } errmsg << " However, " << dimensions << " dimensions were found " "with " << elementCount << " elements"; } if (datawidth != protocolDatawidth) { errmsg << "MSR Protocol Data reports a datasize of " << protocolDatawidth << " bytes, which does not match that of " << datatypeString << " having " << datawidth << " bytes."; } if (errmsg.str().length()) { throw Exception(path, errmsg); } } /****************************************************************************/ MSRProto::Variable::~Variable() { }; /****************************************************************************/ PdCom::Data::Type Variable::genDataType(const char* dt) { struct { const char *name; PdCom::Data::Type type; } *map, msr_dtypemap[] = { { "TDBL", PdCom::Data::double_T }, { "TINT", PdCom::Data::sint32_T }, { "TUINT", PdCom::Data::uint32_T }, { "TCHAR", PdCom::Data::sint8_T }, { "TUCHAR", PdCom::Data::uint8_T }, { "TSHORT", PdCom::Data::sint16_T }, { "TUSHORT", PdCom::Data::uint16_T }, { "TLINT", PdCom::Data::sint64_T }, { "TULINT", PdCom::Data::uint64_T }, { "TFLT", PdCom::Data::single_T }, { NULL,} }; for (map = msr_dtypemap; map->name; map++) { if (!strncmp(dt, map->name, strlen(map->name))) { return map->type; } } std::ostringstream errmsg; errmsg << "MSR reported an unknown data type '" << dt << "'"; throw Exception(errmsg.str()); } /****************************************************************************/ PdCom::Data::Dimension Variable::genDimension(const char* dt, const char* orientation, int rnum, int cnum) { if (!rnum or !cnum) { std::ostringstream errmsg; errmsg << "MSR reported a column or row to have zero elements."; throw Exception(errmsg.str()); } PdCom::Data::Dimension dim; if ((rnum == 1 or cnum == 1) and (!orientation or strncmp(orientation,"MATRIX",6))) dim.push_back(std::max(rnum,cnum)); else { dim.push_back(rnum); dim.push_back(cnum); } return dim; } /****************************************************************************/ size_t Variable::getTransposeSkip(const char* dt, size_t cnum) { return dt and !strncmp(dt, "MATRIX_COL_MAJOR", 16) ? (cnum - 1) : 0; } /****************************************************************************/ 07070100000037000081A400000000000000000000000165BCF78700000B73000000000000000000000000000000000000003300000000pdcom-3.0.11.0.gfcbffda/src/msrproto/MsrVariable.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef MSRVARIABLE_H #define MSRVARIABLE_H #include "pdcom/Variable.h" #include "MsrException.h" #include <string> namespace MSRProto { class ProtocolHandler; /****************************************************************************/ /** MSR variable. */ class Variable: public PdCom::Variable { public: Variable( ProtocolHandler *protocolhandler, std::ostream *os, const char *name, const char *alias, unsigned int index, unsigned int rnum, unsigned int cnum, const char *orientation, const char *datatype, unsigned int datasize, double sampleTime, const char *unit); ~Variable(); protected: ProtocolHandler * const msrHandler; std::ostream * const os; unsigned int const index; /**< protocol index */ std::string const unit; unsigned int const rnum; /**< row count */ unsigned int const cnum; /**< column count */ size_t const datawidth; /**< bytes for a single element */ size_t const transpose_skip; private: /** \return a data type corresponding to the character string */ static PdCom::Data::Type genDataType(const char* dt); static PdCom::Data::Dimension genDimension(const char* dt, const char* orientation, int rnum, int cnum); struct DimensionException: public Exception { DimensionException(const std::string& msg): Exception(msg) {} }; static size_t getTransposeSkip(const char* dt, size_t cnum); }; } // namespace MSRProto #endif // MSRVARIABLE_H /****************************************************************************/ 07070100000038000041ED00000000000000000000000265BCF78700000000000000000000000000000000000000000000002200000000pdcom-3.0.11.0.gfcbffda/src/pdcom07070100000039000081A400000000000000000000000165BCF78700000D4A000000000000000000000000000000000000002700000000pdcom-3.0.11.0.gfcbffda/src/pdcom.h.in/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef PDCOM_H #define PDCOM_H #include "@PACKAGE_NAME@/Process.h" #include "@PACKAGE_NAME@/Variable.h" #include "@PACKAGE_NAME@/Subscriber.h" #include "@PACKAGE_NAME@/Exception.h" // Set for development code; in this case, the variables PDCOM_* // do not evaluate correctly #define PDCOM_DEVEL @DEVEL@ #define PDCOM_MAJOR @PDCOM_MAJOR@ #define PDCOM_MINOR @PDCOM_MINOR@ #define PDCOM_RELEASE @PDCOM_RELEASE@ #define PDCOM_VERSION(A, B, C) (((A) << 16) + ((B) << 8) + (C)) #define PDCOM_VERSION_CODE \ PDCOM_VERSION(PDCOM_MAJOR, PDCOM_MINOR, PDCOM_RELEASE) /** \mainpage * * \section intro Introduction. * * The <a href="http://etherlab.org/en/pdcom">PdCom library</a> provides a * flexible C++ API for non-realtime exchange of process data and is part of * the <a href="http://etherlab.org/en">EtherLab project</a>. It is designed to * be independent of any communication protocols and channels, and shall be * usable under several operating systems and platforms. I. e. it has been * tested successfully under Linux and Windows. * * \section license License * * The PdCom library is released under the terms and conditions of the <a * href="http://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public * License (LGPL)</a>, version 3 or (at your option) any later version. * * \section protocols Implemented communication protocols * * The library provides an abstraction layer for process data communication * protocols together with implementations for these protocols. The protocols * currently implemented are: * * - The MSR protocol from Ingenieurgemeinschaft IgH (http://etherlab.org). * * Other protocols can be easily added. * * \section start Getting started * * The basic approach to take it into operation is to subclass PdCom::Process * to implement the communication channel and to subclass * PdCom::VariableSubscriber to receive the process data. Have a look at the * class documentations to get more information. An example is located in the * example directory. * * \section further Further information * * There is a Qt-based widget library named <a * href="http://etherlab.org/en/pdwidgets">QtPdWidgets</a>, providing process * data visualisation and control widgets, that is based on PdCom. */ #endif // PDCOM_H /****************************************************************************/ 0707010000003A000081A400000000000000000000000165BCF787000017F6000000000000000000000000000000000000002900000000pdcom-3.0.11.0.gfcbffda/src/pdcom/Data.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef PDCOM_DATA_H #define PDCOM_DATA_H #include <vector> #include <memory> #include "Exception.h" namespace PdCom { using std::vector; /****************************************************************************/ /** Data container. * * This serves as a generic data container for the Variable class. */ class Data { friend class Variable; public: /** Data types. */ enum Type { bool_T, uint8_T, sint8_T, uint16_T, sint16_T, uint32_T, sint32_T, uint64_T, sint64_T, single_T, double_T, }; const Type type; /**< Data type. */ /** Type specifier for Dimensions. * * It is essentially a std::vector. */ class Dimension: public vector<size_t> { public: /** Constructor with optional allocator. */ explicit Dimension( const std::allocator<size_t>& a = std::allocator<size_t>() /**< Allocator. */ ); /** Constructor with size. */ explicit Dimension( size_t n, /**< Number of elements. */ const size_t& value = size_t(), /**< Initializer. */ const std::allocator<size_t>& a = std::allocator<size_t>() /**< Allocator. */ ); /** Constructor with iterators. */ Dimension( const vector<size_t>::iterator& first, /**< Start iterator. */ const vector<size_t>::iterator& last, /**< End iterator. */ const std::allocator<size_t>& a = std::allocator<size_t>() /**< Allocator. */ ); /** Constructor with vector initializer. */ Dimension( const vector<size_t>& other /**< Vector to copy dimensions from. */ ); /** Get number of elements. */ size_t getElementCount() const; /** \return Offset of the element specified by \a element. */ unsigned int getOffset( const Dimension* element /**< Index. */ ) const; /** Exception for Zero-Dimension cases. */ struct ZeroDimensionException: public Exception { /** Constructor. */ ZeroDimensionException(): Exception("Zero dimension not allowed") {} }; }; const Dimension dimension; /**< Dimensions. */ /** \return Storage requirement of data type */ static size_t getTypeWidth( Type type /**< Data type to calculate the width of. */ ); /** Allocator for the Data class. */ class Allocator { public: /** Constructor. */ Allocator() {}; /** Destructor. */ virtual ~Allocator() {}; /** Allocate \a n objects of type \a t. * * Redefine this in a derived class, if necessary. */ virtual char* allocate( size_t n, /**< Number of elements. */ Type t /**< Type of the elements. */ ) { return new char[getTypeWidth(t)*n]; } /** Free the memory. * * Redefine this in a derived class, if necessary. */ virtual void deallocate( char* p /**< Pointer to allocated memory. */ ) { delete[] p; } }; /** Constructor. */ Data( const Type& t, /**< Data type. */ const Dimension& dim, /**< Dimensions. */ const Allocator& a = Allocator() /**< Allocator to use. */ ); virtual ~Data(); /** Get the internal data pointer. */ const char* getDataPtr( const Dimension* idx = 0 /**< Index. */ ) const; protected: char* dataPtr; /**< Pointer to the data memory. */ const size_t elementCount; /**< Number of elements. */ const size_t memSize; /**< Data size in byte. */ /** Allocates the data memory using the internal allocator. */ void allocateMemory(); private: Allocator allocator; /**< Allocator used by allocateMemory(). */ }; } // namespace #endif // PDCOM_DATA_H 0707010000003B000081A400000000000000000000000165BCF78700000CC4000000000000000000000000000000000000002E00000000pdcom-3.0.11.0.gfcbffda/src/pdcom/Exception.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef PDCOM_EXCEPTION_H #define PDCOM_EXCEPTION_H #include <string> #include <sstream> #include <stdexcept> namespace PdCom { /****************************************************************************/ /** Exception base class. */ class Exception: public std::runtime_error { public: /** Constructor with std::string parameter. */ Exception( const std::string &s /**< Message. */): std::runtime_error(s) {} /** Constructor with std::ostringstream parameter. */ Exception( const std::ostringstream &s /**< Message. */ ): std::runtime_error(s.str()) {} /** Constructor with const char pointer parameter. */ Exception( const char *s /**< message. */ ): std::runtime_error(s) {} }; /** Exception concerning a variable. */ class VariableException: public Exception { public: /** Constructor with std::string parameter. */ VariableException( const std::string &s /**< Message. */): Exception(s) {} /** Constructor with std::ostringstream parameter. */ VariableException( const std::ostringstream &s /**< Message. */ ): Exception(s.str()) {} /** Constructor with const char pointer parameter. */ VariableException( const char *s /**< message. */ ): Exception(s) {} }; /** Exception concerning the protocol handling. */ class ProtocolException: public Exception { public: /** Constructor with std::string parameter. */ ProtocolException( const std::string &s /**< Message. */): Exception(s) {} /** Constructor with std::ostringstream parameter. */ ProtocolException( const std::ostringstream &s /**< Message. */ ): Exception(s.str()) {} /** Constructor with const char pointer parameter. */ ProtocolException( const char *s /**< message. */ ): Exception(s) {} }; } // namespace PdCom #endif // PDCOM_EXCEPTION_H /****************************************************************************/ 0707010000003C000081A400000000000000000000000165BCF787000004E3000000000000000000000000000000000000002E00000000pdcom-3.0.11.0.gfcbffda/src/pdcom/Makefile.am#----------------------------------------------------------------------------- # # $Id$ # # Copyright (C) 2009 Richard Hacker <lerich@gmx.net> # Florian Pose <fp@igh-essen.com> # # This file is part of the PdCom library. # # The PdCom library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # The PdCom library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. # #----------------------------------------------------------------------------- include_subdir = $(includedir)/$(PACKAGE_NAME) include_sub_HEADERS = \ Exception.h \ Time.h \ Subscriber.h \ Process.h \ Data.h \ Variable.h noinst_HEADERS = RawData.h #----------------------------------------------------------------------------- 0707010000003D000081A400000000000000000000000165BCF7870000373D000000000000000000000000000000000000002C00000000pdcom-3.0.11.0.gfcbffda/src/pdcom/Process.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * * vim: tw=78 spelllang=en spell * ****************************************************************************/ #ifndef PDCOM_PROCESS_H #define PDCOM_PROCESS_H #include "Exception.h" #include "Time.h" #include <list> #include <map> #include <set> #include <string> /** Process::sendBroadcast() is available. */ #define PDCOM_HAVE_BROADCAST /****************************************************************************/ namespace PdCom { class ProtocolHandler; class Variable; class ProcessStreambuf; /****************************************************************************/ /** Process interface class. * * This is the main class of PdCom. A Process is the abstraction of an * existing real-time process, providing methods to access the process' * variables. * * Process shall provide non-real-time process data communication to real-time * processes, independent of the protocol. Currently, only the XML-based MSR * protocol used by the EtherLab project (http://etherlab.org/en) is * implemented, but other protocols can be added easily. * * It is important to note that PdCom does not communicate with the real-time * process directly. System calls are kept to a minimum and only portable * common C/C++ library functionality is required. Communication input and * output has to be implemented by the user of this library, which enables the * use of this library within an external select() loop. Instead of read()ing * and write()ing directly to the stream (which require system calls and can * block), these functions are left to the implementation of PdCom. Process * only provides a method to parse a buffer with incoming data from the * real-time process, and another to indicate that it wishes to send data to * the real-time process. * * This method provides maximum portability across various platforms and * programming environments. * * The physical communication (network, socket, etc) has to be implemented by * subclassing Process and reimplementing its virtual methods. The example/ * directory contains an example implementation. * * The methods to access the process variables should only be used after * sigConnected() is called or isConnected() returns \a true. */ class Process { friend class Variable; friend class ProtocolHandler; public: /** Constructor. * * \param buflen Buffer length for outgoing communication to * the real-time process. */ Process(unsigned int buflen = 4096); /** Destructor. */ virtual ~Process(); /** Set to true to disable changing variables in the process */ bool readOnly; /** Get information map from Protocol Handler. * * The return map \b must contain: * \arg \c protocol: Name of the protocol (PdCom|MSR). * * The return map \b can contain: * \arg \c features: List of protocol specific features. * \arg \c app: Application name. * \arg \c appversion: Application version. * \arg \c version: Protocol version number. * * Other information is allowed. The list can change depending * on the state of protocol initialisation. * * If no protocol handler is initialised, an empty map is returned. * * \return map of name->feature */ std::map<std::string, std::string> getProtocolInformation() const; /** Process variable set. * * Used as return value of getVariables(). */ typedef std::set<Variable *> VariableSet; /** Get a set of all variable paths. * * This method returns the path of all known process variables as a * set. * * If this method is called prior to the completion of protocol * initialisation, the set may be incomplete. * * \return Set of variables. */ const VariableSet &getVariables() const; /** Find a variable by path. * * This searches the variable set for a variable with the given path. * * If this method is called prior to the completion of protocol * initialisation, it may be possible that a path is not found * even though it exists in the real-time process. * * \retval Pointer to the variable * \retval NULL if not found. */ Variable *findVariable( const std::string &path /**< Path of the variable to find. */ ) const; /** Process connected. * * This is \a true, after sigConnected() was called and the variable * set if filled. * * \retval True if protocol initialisation has been completed. */ bool isConnected() const; /** Check output buffer. * * Poll the status of the output buffer. * * \retval True if the output buffer has data to be sent. * \retval False if there is no data in the output buffer. */ bool hasData() const; /** Structure for client interaction */ typedef struct { std::string prompt; /**< Prompt to show the user */ std::string help; /**< Help string */ std::string response; /**< Users response, possibly containing * a default */ } ClientInteraction; /** Prompt the client for interaction. * * This method is called by protocol handlers to request information * required for login/authentication. Present the user with the list, * put the user's answer in response. * * The following prompts are standard across various protocols. * These can then be localised. * - Username * - Hostname * - Applicationname * * Various protocols have different values for \a prompt: * * MSR Protocol: * \arg \c Username Enter user name. * \arg \c Hostname Enter host name. * \arg \c Applicationname Enter name of application. * * \param title Title for client interaction. * \param description Description of the interaction. * \param help Detailed help instructions. * \param il Interaction list. * * \retval True for a positive response. * \retval False for a cancel. */ virtual bool clientInteraction( const std::string& title, const std::string& description, const std::string& help, std::list<ClientInteraction>& il ); /** Reset to initial state. * * This will cause the Process object to discard everything it knows * about the real-time process. Call this if the communication * channel is cut and needs to be set up again, for example. * * References to Variable will be invalid after this call. * All variable subscriptions will be cleared automatically, thereby * calling Subscriber::notifyDelete(). */ void reset(); /** Successfully connected to process. * * This method is called when the protocol handler has completed * protocol initialisation. Before this method is called, process * variables may not be complete and calls to getVariables() and * findVariable() should be refrained from as they could deliver * incomplete results. * * This signal is called within the context of newData(). * * Reimplement this method to receive the signal. */ virtual void sigConnected(); /** Request to send data to the process. * * This is a signal is generated by the protocol handler notifying * that there is data in its output buffer waiting to be transmitted. * * This signal is called within the context of newData(). * * The data is only transmitted upon calling writeReady() and its * subsequent call to sendData(). * * Reimplement this in your derived class. The default implementation * calls writeReady() until the output buffer is empty. */ virtual void sendRequest(); /** Ready to write. * * Call this method to notify the Process object that data can be * written to the process. It in turn calls sendData() with the * actual data to be transmitted. * * \retval <0 the (negative) return values from the call to * sendData(). * \retval >0 There are still data waiting to be transmitted. * \retval 0 Transmission completed. */ int writeReady(); /** Request to send data. * * Reimplement this method in your derived class. This method is * called in the writeReady() context and it requests to send \a len * bytes from \a buf to the real-time process. * * Return the number of bytes written, negative numbers for errors. * Negative values are returned in the call to writeReady(). */ virtual int sendData( const char *buf, /**< Buffer containing the data to send. */ size_t len /**< Number of bytes in \a buf. */ ) = 0; /** New data has arrived. * * Call this method for the protocol handler to process the new data * that has arrived from the real-time process. * * \throw ProtocolException when there is an unrecoverable protocol * error. When this happens, the process has to be reset(). * However, resetting may be unsuccessful due to the error * being caused again. * * \return Number of bytes processed */ size_t newData( const char *buf, /**< Buffer with new data. */ size_t len /**< Number of bytes in \a buf. */ ); /** Log levels. * * \sa processMessage() * \sa protocolLog() * */ typedef enum { LogError, /**< Error level */ LogWarn, /**< Warning level */ LogInfo, /**< Infomational level */ LogDebug /**< Debug level */ } LogLevel_t; /** Message from the real-time process. * * Reimplement this method to receive process messages. * * This signal is called within the context of newData() * * The default implementation will put these messages on stdout. */ virtual void processMessage( const Time& time, /**< Time when message was sent */ LogLevel_t level, /**< Severity level */ unsigned int messageNo, /**< Message Number */ const std::string& message /**< Plain text */ ) const; /** Message from the protocol handler. * * Reimplement this method to receive various messages that are * generated by the protocol handler. * * This signal is called within the context of newData() * * The default implementation puts these messages on stderr. */ virtual void protocolLog( LogLevel_t level, /**< Severity level */ const std::string& message /**< Plain text */ ) const; /** Send a broadcast message to the server and other clients. * * Check PDCOM_HAVE_BROADCAST define for availability. */ void sendBroadcast(const std::string &, const std::string &attr = "text"); private: PdCom::ProcessStreambuf * const sb; /**< Stream buffer. */ std::ostream * const os; /**< Output stream. */ std::ios_base::fmtflags os_flags; /**< Initial flags of the #os. */ LogLevel_t logLevel; ProtocolHandler *handler; /**< The protocol-specific handler. */ VariableSet variableSet; /** Delete a variable from the set. * * Called by Variable. */ void variableDeleted(Variable* pv); /** Add a variable to the set. * * Called by Variable. */ void newVariable(Variable *pv); void rmVariable(Variable *pv); /** Called by #handler when it has finished initialisation. */ void protocolInitialised(); }; /****************************************************************************/ inline const std::set<Variable *> &Process::getVariables() const { return variableSet; } /****************************************************************************/ } // namespace PdCom #endif // PDCOM_PROCESS_H /****************************************************************************/ 0707010000003E000081A400000000000000000000000165BCF787000008AB000000000000000000000000000000000000002C00000000pdcom-3.0.11.0.gfcbffda/src/pdcom/RawData.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef PDCOM_RAWDATA_H #define PDCOM_RAWDATA_H #include "AbstractData.h" namespace PdCom { /****************************************************************************/ /** Raw data template. */ template <class T> class DataType: public AbstractData { public: /** Constructor. */ DataType( const Type& type /**< Data type. */ ): AbstractData(type) {} /** Destructor. */ ~DataType() {} private: void getValue(double* dst, size_t n, const Scale* scale, const Type::Dimension* dim) { unsigned int offset = dim ? type.dimension.getOffset(dim) : 0; if (scale) { for (unsigned int i = 0; i < n; i++) dst[i] = double(((T*)dataPtr)[i+offset]) * scale->gain + scale->offset; } else { for (unsigned int i = 0; i < n; i++) dst[i] = double(((T*)dataPtr)[i+offset]); } } }; } // namespace PdCom #endif // PDCOM_RAWDATA_H /****************************************************************************/ 0707010000003F000081A400000000000000000000000165BCF78700000A8D000000000000000000000000000000000000002F00000000pdcom-3.0.11.0.gfcbffda/src/pdcom/Subscriber.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef PDCOM_SUBSCRIBER_H #define PDCOM_SUBSCRIBER_H namespace PdCom { class Variable; /****************************************************************************/ /** Variable subscriber. * * To receive real-time process values, the Variable can be * subscribed by a Subscriber. * * In order be able to receive these notifications, subclass from * Subscriber and implement the notify() and variableDeleted() * methods. * * You may safely subclass from both Process and Subscriber in * the same class for simple applications. */ class Subscriber { public: /** Constructor. */ Subscriber() {}; /** Destructor. */ virtual ~Subscriber() {}; /** New value notification. * * Called by Variable to notify the subscriber of a new value. * * Calling pv->unsubscribe() is not allowed within this context. * * Reimplement this method in the derived class. */ virtual void notify( Variable *pv /**< The variable having a new value. */ ) = 0; /** Process Variable is deleted * * When a Variable is deleted, it informs all * Subscribers about its impending death. It is therefor * not allowed to change anything in the Variable any more. */ virtual void notifyDelete( Variable *pv /**< The variable that is being deleted */ ) = 0; }; } // namespace PdCom #endif // PDCOM_SUBSCRIBER_H /****************************************************************************/ 07070100000040000081A400000000000000000000000165BCF78700000FF7000000000000000000000000000000000000002900000000pdcom-3.0.11.0.gfcbffda/src/pdcom/Time.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef PDCOM_VARIABLETIME_H #define PDCOM_VARIABLETIME_H #include <sys/time.h> #include <string> namespace PdCom { /****************************************************************************/ /** ProcessVariable time. * * This is the time class of PdCom. It can contain absolute times (since * epoch) and relative times. The base unit is always a second. */ class Time { public: /** Constructor. * * Sets the time value to zero. */ Time(); /** Copy constructor. */ Time(const Time &); /** Constructor with double parameter. */ Time(double); /** Constructor with time_t parameter. */ Time(time_t); /** Assignment operator. */ Time &operator=(double); /** Combined addition and assignment operator. */ Time &operator+=(const Time &); /** Combined substration and assignment operator. */ Time &operator-=(const Time &); /** Addition operator. * * \return Sum of the time and the parameter. */ Time operator+(const Time &) const; /** Substraction operator. * * \return Difference between the time and the parameter. */ Time operator-(const Time &) const; /** Multiplication operator. * * \return Product of the time and the parameter. */ Time operator*( double seconds /**< Time to multiply with. */ ) const; /** Equal operator. * * \retval True if the time is equal to the parameter. */ bool operator==(const Time &) const; /** Greater operator. * * \retval True if the time is greater than the parameter. */ bool operator>(const Time &) const; /** Greater-or-equal operator. * * \retval True if the time is greater than or equal to the * parameter. */ bool operator>=(const Time &) const; /** Less operator. * * \retval True if the time is less than the parameter. */ bool operator<(const Time &) const; /** Less-or-equal operator. * * \retval True if the time is less than or equal to the * parameter. */ bool operator<=(const Time &) const; /** Conversion to bool. * * \retval True if the time is non-zero. */ operator bool() const; /** Conversion to double. * * \returns Seconds and fractional seconds in a double value. */ operator double() const; /** String representation * * \return String */ std::string str() const; private: struct timeval t; }; } // namespace PdCom #endif // PDCOM_VARIABLETIME_H /****************************************************************************/ 07070100000041000081A400000000000000000000000165BCF78700009845000000000000000000000000000000000000002D00000000pdcom-3.0.11.0.gfcbffda/src/pdcom/Variable.h/***************************************************************************** * * $Id$ * * Copyright (C) 2009 - 2012 Richard Hacker <lerich@gmx.net> * Florian Pose <fp@igh-essen.com> * * This file is part of the PdCom library. * * The PdCom library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * The PdCom library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the PdCom Library. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef PDCOM_VARIABLE_H #define PDCOM_VARIABLE_H #include <inttypes.h> #include <string> #include <set> #include <map> #include <list> #include <vector> #include <bitset> #include "Time.h" #include "Data.h" #include "Exception.h" namespace PdCom { class Process; class Subscriber; /****************************************************************************/ /** Process variable. * * A real-time process usually provides a set of variables, i. e. signals and * parameters, that are represented as objects of this class. After Process * has connected to the real-time process, it fetches information about the * variables and fills its set of Variable objects. Pointers to process * variables can be obtained via Process::getVariableMap() or * Process::findVariable(). Variables are identified by a path string. * * To receive variable values, it has to be subscribed to. The subscriber is * then notified when a new sample arrives from the real-time process. The * variable's value can only be accessed within the notify call to the * subscriber. See the Subscription and Subscriber class documentation for * more information. * * The Variable object itself provides information about the variable, i. e. * - the path name, - the data type and internal structure (scalar, vector, * matrix, etc.), - if it is readable and/or writable, - the sample time * inside the real-time process. * * Data contained in a variable is essentially a row major matrix. Vectors and * scalars are subsets of these. * * In this class, only the public interface is relevant. */ class Variable: public Data { friend class Process; public: /** Constructor. * * A process variable can't exist without a parent process object and * is usually created by the process itself. */ Variable( Process *process, /**< Parent */ const std::string &path, /**< Path. */ const std::string &alias, /**< Alias. */ const Data::Type& type, /**< Data type. */ const Data::Dimension& dim, /**< Data dimension. */ double samplePeriod /**< Original sampling period */ ); /** Destructor. */ virtual ~Variable(); /** The parent process. */ Process * const process; /** The variable's path. */ const std::string path; /** The variable's alias name. * * Some protocols support a second name for a variable. */ const std::string alias; /** The #samplePeriod inside the process. */ const double samplePeriod; /** Test whether the Variable is readable. */ bool isRead() const { return readable; } /** Test whether the Variable is writeable. */ bool isWrite() const { return writeable; } /** Poll the variable once. * * The given subscriber will get one notify with the polled value. */ void poll( Subscriber* s /**< Subscriber that shall receive the value. */ ); /** Subscribe to a Variable * * As long as the Subscriber has not called unsubscribe(), it * will be notified of a destruction of Variable. * * It is therefor essential that the Subscriber informs the Variable * if it no longer exists, e.g. by calling unsubscribe() in its * destructor, otherwise a runtime exception will occur upon * destruction of the Variable * * \param s The Subscriber() receiving the notify() * \param interval The subscription interval: * * == 0 event method: the value is sent on value change only * * > 0 stream method: the value is sent at the requested * intervals. * * Note that protocols do not have to implement all of the * different subscription methods simultaneously, or may exclude * one method if another is active, e.g. event and stream methods * may exclude each other. * * \throw VariableException when it is impossible to subscribe this * variable with the giben interval. */ void subscribe(Subscriber* s, double interval); /** Cancel a subscription * * Removes a Subscriber from all subscriptions to this variable. */ void unsubscribe(Subscriber*); /** Get the current modification time. */ const Time& getMTime() const { return mtime; } /** Scale vector. */ struct Scale { /** Constructor. */ Scale( double gain = 1.0, /**< Gain factor. */ double offset = 0.0 /** Offset. */ ): gain(gain), offset(offset) {} double gain; /**< Gain factor. */ double offset; /**< Offset. */ }; /** Write the variable's contents directly into a primary data type. * * \param dst Destination variable pointer. * \param n Number of elements to write to \c dst. * \param scale Scale object to use, or \a NULL. * \param idx Index to use, or \a NULL. * * @{ */ void getValue(double* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; void getValue(float* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; void getValue(uint8_t* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; void getValue(int8_t* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; void getValue(uint16_t* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; void getValue(int16_t* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; void getValue(uint32_t* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; void getValue(int32_t* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; void getValue(uint64_t* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; void getValue(int64_t* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; void getValue(bool* dst, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0) const; /** @} */ /** Set the variable's value directly from a primary data type. * * \param src Source value pointer. * \param n Number of elements in \c src. * \param scale Scale object to use, or \a NULL. Inverse scaling is * used. * \param idx Index to use, or \a NULL. * * @{ */ void setValue(const double* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); void setValue(const float* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); void setValue(const uint8_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); void setValue(const int8_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); void setValue(const uint16_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); void setValue(const int16_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); void setValue(const uint32_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); void setValue(const int32_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); void setValue(const uint64_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); void setValue(const int64_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); void setValue(const bool* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); /** @} */ /** Write the variable's value to a data object. */ void getValue( Data& dst, /**< Destination. */ const Scale* scale = 0, /**< Scale object. */ const Dimension* idx = 0 /**< Index. */ ) const; /** Set the variable's value from a data object. */ void setValue( const Data& src, /**< Source. */ const Scale* scale = 0, /**< Scale (used inversely). */ const Dimension* idx = 0 /**< Index. */ ); protected: /** Set to true if value is readable */ bool readable; /** Set to true if value is writeable */ bool writeable; /** Notify all subscribers about a new stream value. * * \param decimation to notify */ void notifySubscribers(unsigned int decimation); /** Notify all subscribers about a new polled value. */ void notifyPoll(); /** Add a subscription. * * Reimplement this method in the specialisation. This requests * the variable to be sent with the requested decimation. * * \param interval * * 0 - send on change * * >0 - stream */ virtual unsigned int addTransmissionInterval(double interval) = 0; /** Poll the variable. * * Has to be reimplemented by derived classes. */ virtual void pollVariable() = 0; /** Cancel a subscription. */ virtual void rmTransmissionDecimation( int decimation /**< Decimation to remove. */ ) = 0; /* These variables are used by the derived classes for their * data exchange with the Application and the clients */ Time mtime; /**< Modification time of data. */ /** Notification that the data value has changed. * * Reimplement this in derived classes. */ virtual void valueChanged( const char* dataPtr, /**< Pointer to changed data. */ size_t n /**< Number of changed elements. */ ); /** Force write the variable's value directly from a primary data type. * This is used internally to set the value without checking if the * variable is writeable. * * \param src Source value pointer. * \param n Number of elements in \c src. * \param scale Scale object to use, or \a NULL. Inverse scaling is * used. * \param idx Index to use, or \a NULL. * * @{ */ char* pushValue(const double* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); char* pushValue(const float* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); char* pushValue(const uint8_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); char* pushValue(const int8_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); char* pushValue(const uint16_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); char* pushValue(const int16_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); char* pushValue(const uint32_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); char* pushValue(const int32_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); char* pushValue(const uint64_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); char* pushValue(const int64_t* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); char* pushValue(const bool* src, size_t n = 1, const Scale* scale = 0, const Dimension* idx = 0); /** @} */ private: static Time nullTime; /**< Static nulltime. A reference to this is returned in the default implementation of getValue(). */ /* Called by Process to let the Variable inform Subscribers about * an impending death */ void cancelSubscribers(); /* The set of all subscribers. * This list is used when cancelSubscribers() is called */ typedef std::map<Subscriber*,unsigned int> SubscriberMap; SubscriberMap subscriberMap; /* A map of subscription types * key: -1 : poll subscriptions * 0 : event subscriptions * >0 : stream subscriptions with the key as the decimation */ typedef std::set<Subscriber*> Subscribers; typedef std::map<int,Subscribers> DecimationSubscribers; DecimationSubscribers decimationSubscribers; void removeStreamSubscribers(Subscriber* vs); typedef void (*convert_t)( const void *src, /**< Source data. */ void *dst, /**< Destination buffer. */ size_t count, /**< Number of values in \a src to convert. */ const Scale *scale /**< Scale vector(s) to use. */ ); /** Read conversion function matrix. */ static const convert_t read_convert[11][11]; /** Write conversion function matrix. */ static const convert_t write_convert[11][11]; /** Conversion functions without scaling. */ static const convert_t read_convert_noscale[11][11]; static const convert_t write_convert_noscale[11][11]; const convert_t *read; const convert_t *write; const convert_t *read_noscale; const convert_t *write_noscale; static void boolToBool(const void *src, void* dst, size_t count, const Scale* scale); static void boolToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void boolToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void boolToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void boolToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void boolToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void boolToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void boolToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void boolToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void boolToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void boolToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_boolToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_boolToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_boolToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_boolToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToBool(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void uint8ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_uint8ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_uint8ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_uint8ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_uint8ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToBool(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void sint8ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_sint8ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_sint8ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_sint8ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_sint8ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToBool(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void uint16ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_uint16ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_uint16ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_uint16ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_uint16ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToBool(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void sint16ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_sint16ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_sint16ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_sint16ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_sint16ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToBool(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void uint32ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_uint32ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_uint32ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_uint32ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_uint32ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToBool(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void sint32ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_sint32ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_sint32ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_sint32ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_sint32ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToBool(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void uint64ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_uint64ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_uint64ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_uint64ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_uint64ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToBool(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void sint64ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_sint64ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_sint64ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_sint64ToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_sint64ToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToBool(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void doubleToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToBool(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_doubleToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToBool(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_doubleToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void singleToBool(const void *src, void* dst, size_t count, const Scale* scale); static void singleToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void singleToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void singleToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void singleToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void singleToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void singleToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void singleToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void singleToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void singleToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void singleToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToBool(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void write_singleToSingle(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToBool(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToUint8(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToSint8(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToUint16(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToSint16(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToUint32(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToSint32(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToUint64(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToSint64(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToDouble(const void *src, void* dst, size_t count, const Scale* scale); static void read_singleToSingle(const void *src, void* dst, size_t count, const Scale* scale); }; } // namespace PdCom #endif // PDCOM_VARIABLE_H /****************************************************************************/ 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!923 blocks
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor