⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commoncpp2.texi

📁 贡献一份commoncpp2,有兴趣的可以研究一下
💻 TEXI
📖 第 1 页 / 共 4 页
字号:
@item --prefixCommon C++ Installation path prefix. For example, @code{/usr/local}.@item --versionCommon C++ version. For example, @code{1.0.0}.@item --flagsC++ preprocessor flags. For example, @code{-I/usr/local/include/cc++2-I/usr/local/include -D_GNU_SOURCE}.@item --libsC++ linker options for the main Common C++ library(@code{ccgnu2}). For example, @code{-L/usr/local/lib -lccgnu2 -ldl-pthread}.@item --gnulibsC++ linker options for the main Common C++ library(@code{ccgnu2}). For example, @code{-L/usr/local/lib -lccgnu2 -ldl-pthread}.@item --iolibsC++ linker options for the input/output Common C++ library(@code{ccgnu2}). For example, @code{-L/usr/local/lib -lccgnu2 -ldl-pthread}.@item --extlibsC++ linker options for the Common C++ ``extension'' library(@code{ccext2}). For exmple, @code{-lccext2 -lxml2 -lz}.@item --stdlibsC++ linker options for the whole Common C++ (@code{ccgnu2} and@code{ccext2}). For example, @code{-L/usr/local/lib -lccext2 -lccgnu2-lxml2 -lz -ldl -pthread}.@item --includesCommon C++ specific include path. For example,@code{/usr/local/include/cc++2}.@end table@c -----------------------------------------------------------------------@node Automake Services@chapter Automake Services@cindex Automake Services@cindex automake services@cindex automake macros@cindex ost_commoncxx.m4@cindex configure.in@cindex configure.acIf you are using automake, you can add the @file{ost_check2.m4} macrosto your projects autoconf "m4" directory and use several CCXX2_ macrosfor your convenience.  A "minimal" @file{configure.in} or@file{configure.ac} can be constructed as:@exampleAC_INIT(something...)AC_PROG_CXXAC_PROG_CXXCPPAM_PROG_LIBTOOLAM_INIT_AUTOMAKE(....)AM_CONFIG_HEADER(my-local-config.h)OST_CCXX2_VERSION(1.0.0)@end exampleWhere @samp{1.0.0} means configure will check for GNU Common C++ 21.0.0 or later. These are the macros currently provided:@table @code@cindex OST_CCXX2_VERSION@item OST_CCXX2_VERSION([MINIMUM-VERSION[,ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]]])Test for usable version of CommonC++.@cindex OST_CCXX2_XML@item OST_CCXX2_XML([ACTION-IF-TRUE[,ACTION-IF-FALSE]])Test whether the CommonC++ library was compiled with XML parsing support.@cindex OST_CCXX2_HOARD@item OST_CCXX2_HOARDWill test for and, if found, add the SMP optimized Hoard memoryallocator to your application link LIBS.@cindex OST_CCXX2_FOX@item OST_CCXX2_FOXTest for the FOX toolkit.@end table@c -----------------------------------------------------------------------@node Configuring Sources@chapter Configuring Sources@cindex Configuring SourcesWhen building GNU Common C++ on platforms that support the use ofconfigure, the following specific configuration options are provided:@table @code@item --with-pthread[=lib]using specified pthread library@item --with-linuxthreadsuse linux kernel mode library@item --without-xmlDisable xml support@item --with-ftpEnable ftp support@item --with-memauditEnable memory auditing@item --with-stlport[=dir]using SGI portable C++ stream library,ie: /usr/local, not all include directory@item --enable-debugcompile for debugging@item --enable-profilingcompile for profiling@end table@c -----------------------------------------------------------------------@node Developer Documentation@chapter Developer Documentation@cindex Developer DocumentationThis chapter contains information of interest for developers ofcomponents for the GNU Common C++ framework.@menu* Coding Style::             How a CommonC++ 2 source file should be written.* Porting::                  Common porting related problems and practices.@end menu@c -----------------------------------------------------------------------@node Coding Style@section Coding Style@cindex Coding StyleHow a CommonC++ 2 source file should be written.@menu* Naming Convention::       Overall GNU Common C++ naming conventions.* Class Encapsulation::     Class interface design guidelines.@end menu@c -----------------------------------------------------------------------@node Naming Convention@subsection Naming Convention@cindex Naming Convention@itemize@item @strong{Classes and structs}. Begin with uppercase with word parts capitalized (ThisIsAClass)@item @strong{Method (function member, also static member)}.Begin with lowercase with word parts capitalized (setSomething, send).If a member variable is set, a @code{setXxxx} style name should beused, and if a member variable is fetched, a @code{getXxxx} style nameshould be used.  Sometimes things might both set and perform anaction, like @code{setError} in place of @code{Error} in the olderrelease, in which case, set should still be used as the prefix.Function to handle some event (such as data arrival) should begin with@code{on} (ex: @code{onInput})@item @strong{Data member}.Begin with lowercase with word parts capitalized(@code{currentThread}) private member can begin with underscore (_).@item @strong{Global function}.Begin with lowercase with word parts capitalized (@code{getThread}).@item @strong{Enumeration type}.Begin with uppercase with word parts capitalized (@code{Error}).@item @strong{Enumeration item}.Begin with lowercase with word parts capitalized (@code{errSuccess}).First word should refer to enumeration type (@code{errFailure},cancelImmediate). For error enum we use the prefix @code{err}(everyone should understand the meaning).@item @strong{Member data types}.Sometimes a class might use internal member data types or structs.These should be written using @code{class} rather than struct whereverpossible and treated as inner @code{classes}.  Hence, they would becapitalized in the same conventions of a class.@end itemize@c -----------------------------------------------------------------------@node Class Encapsulation@subsection Class Encapsulation@cindex Class Encapsulation@itemize@item @strong{Friend functions}.To clean up the namespace we are looking to eliminate @emph{friendfunctions} that exist in the default or ost namespace and we aresuggesting that in many cases static member functions should be usedin place of friend functions unless the friend function is actuallyused in multiple classes.A typical example of this is found in things like @code{getXXX}, whichmight be a friend function for finding a specific named instance of@code{XXX} thru a self organized link list contained in @code{XXX}.Rather, it is suggested for this to use a static member something like@code{XXX::find}.@item @strong{Scope of view and inheritance}.In many cases we combine and mix classes directly in GNU Common C++(multiple inheritence).  Hence, classes have to be well designed forthis possibility.  Ideally things that should not be exposed toderived classes should be made private so that clashes mixing similarclasses with common named members do not need to occur.@item  @strong{Access to member properties}.A well formed GNU Common C++ class need not expose more than isnessisary for it's practical and effective use in derived classes orthru proper public methods.  Ideally set and get members should beused to manipulate internal member variables thru public interfacesrather than exposing property values directly thru publicdeclarations.  These set and get methods should use appropriate validrange and error checking logic.Member properties can often be made visible protected to optimize thecode of derived classes, and care then needs to be taken when creatingderived classes to make sure they do have reasonable error checkingwhen needed.@item @strong{Constructors and destructors}.It is very common in GNU Common C++ for the constructor to create orobtain a resource that remains in scope as long as the object does,and is then releas\ed in the destructor when the object falls out ofscope.  Things like Mutexes, Threads and Semaphores and such very muchbehave this way.@end itemize@c -----------------------------------------------------------------------@node Porting@section Porting@cindex PortingOnly for no-remake same problem :).@itemize @bullet@cindex FreeBSD@cindex pthread_join@item FreeBSD: assuming having thread A and B. If A call pthread_join on B and B call pthread_detach and then exit thread A hang.@cindex Solaris@item Solaris: On multiple inheriting from streambuf and iostream togetherstreambuf should inherited first (and initialized too).@cindex Win32@cindex MSVC@cindex DLL@item Win32/MSVC6: if you use CC++ DLL library you MUST use C++ DLL library. @code{iostream} use a pointer to object. This object pointer can bedifferent from library static linked and dinamically linked, soiostream see distinct object, causing strange exception and crashes.@cindex GCC@item @acronym{GCC}: including declaration for polimorphic class causelink to typeinfo, but typeinfos are defined only in module withclasses constructors Include only needed header (this problemdisappear with optimization).@end itemize@c %** end of body@c -----------------------------------------------------------------------@node Licenses@appendix Licenses@menu* GNU Free Documentation License::            License for this document.* GNU General Public License::                License for the library.* GNU Common C++ Linking Exception::          Library linking exception.@end menu@include fdl.texi@include gpl.texi@c -----------------------------------------------------------------------@node GNU Common C++ Linking Exception@appendixsec GNU Common C++ Linking Exception@cindex GNU Common C++ Linking ExceptionAs a special exception to the GNU General Public License, permissionis granted for additional uses of the text contained in its release ofCommon C++.The exception is that, if you link the Common C++ library with otherfiles to produce an executable, this does not by itself cause theresulting executable to be covered by the GNU General Public License.Your use of that executable is in no way restricted on account oflinking the Common C++ library code into it.This exception does not however invalidate any other reasons why theexecutable file might be covered by the GNU General Public License.This exception applies only to the code released under the name CommonC++.  If you copy code from other releases into a copy of Common C++,as the General Public License permits, the exception does not apply tothe code that you add in this way.  To avoid misleading anyone as tothe status of such modified files, you must delete this exceptionnotice from them.If you write modifications of your own for Common C++, it is yourchoice whether to permit this exception to apply to yourmodifications.  If you do not wish that, delete this exception notice.@c -----------------------------------------------------------------------@c %** start of end@node Class and Data Type Index@unnumbered Class and Data Type Index@printindex tp@node Method and Function Index@unnumbered Method and Function Index@printindex fn@node Concept Index@unnumbered Concept Index@printindex cp@bye@c %** end of end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -