ACE TAO Programming [001] 介绍

来源:互联网 发布:thunder下载软件 编辑:程序博客网 时间:2024/04/30 22:09

HomePage: http://www.cs.wustl.edu/~schmidt/TAO.html

Real-time
CORBA
with TAO(TM)
(The ACE ORB)

  1. The TAO Programmer's Guide
  2. Pattern-Oriented Software Architecture: On Patterns and Pattern Languages (POSA5)
  3. Pattern-Oriented Software Architecture: Patterns for Concurrent and Networked Objects

     

oTAO Overview

 

oObtaining TAO

 

oBuilding TAO

 

oTAO Documents

 

oThe TAO FAQ

 

oCORBA Overview

 

oACE and CIAO Overview

 

oJacORB & ZEN Overview

 

oTAO team members

 

oTAO Copyright

 

oTAO Developers Forums

 

oTAO Sponsors

 

oCommercial Support

 

oWho is Using TAO

 

oTAO 3rd Party Integrators

 

爱热闹的人可以看看论坛,不过我逛了逛,收获甚少。

http://www.acejoy.com/space/html/index.html

 

 

 

 

 

 

 

Download

 

下载的时候要注意:下载一个release版本,如果搞开发的话,学习就随便了^_^

ACE kits are released periodically as either of two types:

  1. Release two numbers, such as 5.7. These versions are stable and well tested. You should use release versions for product development unless you need to add a new feature to ACE in support of your project.

  2. Beta three numbers, such as 5.7.2. These versions are development snapshots: the "bleeding edge." They may contain bug fixes above the previous release, but they may also contain more bugs or new features whose effects and interactions have not yet been well tested.

 

The first beta kit following each release—for example, 5.7.1—is traditionally reserved for bug fixes to the release and usually doesn't contain any new features or API changes. This is sometimes referred to as a BFO (bug fix only) version. However, it doesn't go through all the same aggressive testing that a release does.

Downloading Freely Available Versions of ACE, TAO, and CIAO

Our process for developing and releasing ACE, TAO, and CIAO, as well as the role of major, minor, andmicro release kits is described in detail in the DOC group's development and release process document. Please check that document to decide which version below is more appropriate for your case. You may want to understand the DOC group's bug fixing policies when you make this decision.

The full packages do contain all sources with pre generated makefiles for GNU make, Visual C++ 7.1/8.0/9.0, and GNU autoconf. The sources only packes just contain the sources, you have to generate your own makefiles with MPC.

 

If you are using Windows download a package with a .zip extension, these packages have Windows line feeds. For all other platforms download a .gz/.bz2 package.

  • Latest Micro Release Kit. The latest version of the ACE, TAO, and CIAO micro release kit is available for download below.

    FilenameDescriptionFullSources onlyACE+TAO+CIAO.tar.gzACE+TAO+CIAO (tar+gzip format)[HTTP] [FTP] [HTTP] [FTP] ACE+TAO+CIAO.tar.bz2ACE+TAO+CIAO (tar+bzip2 format)[HTTP] [FTP] [HTTP] [FTP] ACE+TAO+CIAO.zipACE+TAO+CIAO (zip format)[HTTP] [FTP] [HTTP] [FTP] ACE+TAO.tar.gzACE+TAO (tar+gzip format)[HTTP] [FTP] [HTTP] [FTP] ACE+TAO.tar.bz2ACE+TAO (tar+bzip2 format)[HTTP] [FTP] [HTTP] [FTP] ACE+TAO.zipACE+TAO (zip format)[HTTP] [FTP] [HTTP] [FTP] ACE-html.tar.gzDoxygen documentation for ACE+TAO+CIAO (tar+gzip format)[HTTP] [FTP] ACE-html.tar.bz2Doxygen documentation for ACE+TAO+CIAO (tar+bzip2 format)[HTTP] [FTP] ACE-html.zipDoxygen documentation for ACE+TAO+CIAO (zip format)[HTTP] [FTP] ACE.tar.gzACE only (tar+gzip format)[HTTP] [FTP] [HTTP] [FTP] ACE.tar.bz2ACE only (tar+bzip2 format)[HTTP] [FTP] [HTTP] [FTP] ACE.zipACE only (zip format)[HTTP] [FTP] [HTTP] [FTP]

    Patches between older micro release kit versions are available via FTP at this location.

  • Latest Release. The latest release is ACE 5.7, TAO 1.7, and CIAO 0.7 (ACE+TAO+CIAO x.7), please use the links below to download it.ACE+TAO+CIAO x.7 is the same as the micro release x.7.0

    FilenameDescriptionFullSources onlyACE+TAO+CIAO-5.7.tar.gzACE+TAO+CIAO (tar+gzip format)[HTTP] [FTP] [HTTP] [FTP] ACE+TAO+CIAO-5.7.tar.bz2ACE+TAO+CIAO (tar+bzip2 format)[HTTP] [FTP] [HTTP] [FTP] ACE+TAO+CIAO-5.7.zipACE+TAO (zip format)[HTTP] [FTP] [HTTP] [FTP] ACE+TAO-5.7.tar.gzACE+TAO (tar+gzip format)[HTTP] [FTP] [HTTP] [FTP] ACE+TAO-5.7.tar.bz2ACE+TAO (tar+bzip2 format)[HTTP] [FTP] [HTTP] [FTP] ACE+TAO-5.7.zipACE+TAO (zip format)[HTTP] [FTP] [HTTP] [FTP] ACE-5.7-html.tar.gzDoxygen documentation for ACE+TAO (tar+gzip format)[HTTP] [FTP] ACE-5.7-html.tar.bz2Doxygen documentation for ACE+TAO (tar+bzip2 format)[HTTP] [FTP] ACE-5.7-html.zipDoxygen documentation for ACE+TAO (zip format)[HTTP] [FTP] ACE-5.7.tar.gzACE only (tar+gzip format)[HTTP] [FTP] [HTTP] [FTP] ACE-5.7.tar.bz2ACE only (tar+bzip2 format)[HTTP] [FTP] [HTTP] [FTP] ACE-5.7.zipACE only (zip format)[HTTP] [FTP] [HTTP] [FTP]

     

Installation

my OS is redhat el5, so, only the method for linux is here now.

On UNIX platforms

  1. Set ACE_ROOT environment variable as outlined in the ACE installation notes.

     

  2. Build and install ACE under $ACE_ROOT.

     

    • Change directory to $ACE_ROOT/ace and execute make.

       

    • Also build GPERF under $ACE_ROOT/apps/gperf/src

       

  3. Set TAO_ROOT environment variable to $ACE_ROOT/TAO.

     

  4. Build and install the TAO release under $TAO_ROOT.

    TAO also uses GNUmakefiles and project files generated from MPC to compile. The beta or the release distribution will come with stock GNUmakefiles, project files (for VC7.1 and VC 8) and Borland makefiles which were all generated by MPC.

    The easiest and recommended way to compile the complete TAO distribution by simply simply executing make in the $TAO_ROOT directory.

    A smaller subset, that may be of interest to test basic TAO functionality, is: $TAO_ROOT/tao, $TAO_ROOT/TAO_IDL, $TAO_ROOT/tests/Param_Test. Then you can execute the run_test.pl script in $TAO_ROOT/tests/Param_Test and/or follow the instructions contained in the README file in the same directory.

    If you wish to compile the ORB services distributed with TAO, including the Naming_Service you must include $TAO_ROOT/orbsvcs to the list above. Please see the TAO configuration documentation for a discussion on how to create a subset configuration of specific TAO ORB servcies.

    If you wish to compile all the core tao and orbsvcs, including its dependencies in ACE and ACEXML, you can do the following

    1. Unpack the distribution from DOC group's website.
    2. Set the environment variables $ACE_ROOT and $TAO_ROOT.
    3. Create config.h and platform_macros.GNU at the right places
    4. Delete all the GNUmakefiles (or sln and vproj file as the case may be) from the TAO distrbution using the 'find' command.
    5. Change directory to $TAO_ROOT.
    6. Run MPC like this, $ACE_ROOT/bin/mwc.pl TAO_ACE.mwc -type gnuace
    7. Run 'make'.

     

    This will create all the required libraries for TAO and TAO orbsvcs. In step 6, use -type vc71 if you want to generate VC71 project and workspace files for Win32. Please see MPC USAGE document for details on how to generate build files for other compilers and tools.

  5. To test that the TAO release is properly configured, follow instructions on executing the various examples under $TAO_ROOT/tests.

the make process will take so much time to compile everything, so, be patience now.

运行环境的搭建

我的系统是EL5,安装(installace后,可以在自己Home目录下建立个工程,写个小程序跑跑:

/* program name: Demo.cpp */

/* -------------------------------------------------------------------- */

#include "ace/OS.h"

#include "ace/Message_Block.h"

#include "ace/ACE.h" /* the original source of this demo does not have this line. But with out this line */

                                  /* the programming will fail to pass the compilation and linking process. */

int main (int argc, char *argv[])

{

  ACE_Message_Block *head = new ACE_Message_Block (BUFSIZ);

  ACE_Message_Block *mblk = head;

 

  for (;;) {

    ssize_t nbytes = ACE::read_n (ACE_STDIN,

                                  mblk->wr_ptr (),

                                  mblk->size () ) ;

    if (nbytes <=  0)

      break; // Break out at EOF or error.

 

    // Advance the write pointer to the end of the buffer.

    mblk->wr_ptr (nbytes);

 

    // Allocate message block and chain it at the end of list.

    mblk->cont (new ACE_Message_Block (BUFSIZ));

    mblk = mblk->cont ();

  }

  // Print the contents of the list to the standard output.

  for (mblk = head; mblk != 0; mblk = mblk->cont ())

    ACE::write_n (ACE_STDOUT, mblk->rd_ptr (), mblk->length ());

 

  head->release (); // This releases all the memory in the chain.

  return 0;

}

/* -------------------------------------------------------------------- */

 

再用g++来编译运行,命令行是:g++ -g –Wall –I$ACE_ROOT –L$ACE_ROOT/ace –lACE Demo.cpp

会生成a.out,这个程序做什么呢?

        The program reads all data from standard input into a singly linked list of dynamically allocated ACE_Message_Blocks that are chained together by their continuation pointers. It then prints the contents of all the chained message blocks to the standard output and releases their dynamically allocated memory.

        The for loop that prints the contents of the list to the standard output can be replaced by a single call to ACE::write_n (head). This method prints out all the message blocks chained through their cont () pointers using a highly efficient gather-write operation. A similar optimization is used in the Logging_Handler::write_log_record() method on page 90.

        We use the ACE::read_n() and ACE::write_n() methods rather than the C++ iostreams mechanism since not all OS platforms that ACE runs on support C++ iostreams adequately. It's possible to substitute cin and cout on platforms that do support them properly. They may incur additional data copying due to internal buffering, however, and can't take advantage of the gather-write optimization described in the preceding paragraph.

运行起来,为什么没反应呢?

我也没搞明白呢,继续往下学习学习!

 

 

 

 

 

Eclipse for linux 中写ACE程序

 

其实很简单,就是不能搞出DLLlinuxDynamic library工程生出的是xxx.so,估计linux下是不能搞出DLL的,因为平台原因吧,如果高手知道怎么弄,请指点俺一下。

新建工程和一般的CPP工程一样,只是要把工程属性里的GCC C++ Compilerà Directories 下加个Include path -I

My added path is /opt/ins/ace/ACE_wrappers. This is the value of $ACE_ROOT.

再在GCC C++ Compilerà Miscellaneous 下面加个 –L/opt/ins/ace/ACE_wrappers/ace

加这两项其实就是要给g++添加编译时的option

这就能compile程序了。

Link时要加在 GCC C++ Linker à Command里写成

这样:g++ -I/opt/ins/ace/ACE_wrappers –L/opt/ins/ace/ACE_wrappers/ace –lACE

 

按住ctrl 点一些ACE的方法时eclipse报没有index信息,这很不方便,因为我要看这个方法的实现啊什么的,怎么办呢:

Window => Preferences => Indexer => index unused header => select it。(Select indexer:Fast C/C++ Indexer)

 

OK啦。

 

VS 2003

Windows下我是在VS2003 .net下试验的,不太好弄,编译过了,但是link时报了大堆错误,由于没有多少VS上C/C++编程经验,我得以后再搞定这个问题了。Ace安装后examples下有生成好的vcproj文件,所以直接用就行了。比如要写个小程序,但自己搞不定vs怎么设置,就打开生成好的vcproj,把里面原有的main函数注释掉,自己写自己的就行了,编译,link肯定没多大问题。我就这么做的,学习嘛,先学点,看多了,说不定那天会知道怎么设定环境啦。