Code Search for Developers
 
 
  

cache_entry.cc from AlphaMail at Krugle


Show cache_entry.cc syntax highlighted

#include <IMAPTypes.h>
#include <string>
#include <iostream>
#include <map>
#include <vector>

using namespace std;
using namespace IMAP;

struct crap
{
   std::string msg;
   crap(const std::string &s) : msg(s) {}
};

typedef map<long, IMAP::CacheEntry<crap> > crapmap;
typedef vector<IMAP::CacheEntry<crap> > craplist;

int main()
{
   crapmap idmap;
   craplist *stuff;

   stuff = new craplist();

   cout << "Making cache entries" << endl;
   idmap[1] = CacheEntry<crap>(new crap("a"));
   idmap[2] = CacheEntry<crap>(new crap("b"));
   idmap[3] = CacheEntry<crap>(new crap("c"));
   idmap[4] = CacheEntry<crap>(new crap("d"));
   
   cout << "Looking at an empty cache entry:" << endl;
   if(idmap[5].isEmpty())
      cout << "It is properly empty" << endl;
   else
      cout << "ERROR! It is NOT properly empty" << endl;

   cout << "Copying entries to craplist:" << endl;
   stuff->push_back(idmap[2]);
   stuff->push_back(idmap[4]);

   craplist::iterator i;

   cout << "Looking at craplist" << endl;
   for(i=stuff->begin(); i != stuff->end(); i++)
   {
      cout << i->getItem().msg << endl;
   }
   cout << "Deleting craplist" << endl;
   delete stuff;
}




See more files for this project here

AlphaMail

AlphaMail is an accelerated web mail interface with a C++ middleware layer that is more effective than an IMAP proxy which is a highly scalable (10k+ users). The interface includes modern features, Section 508 compliance, and universal browser support.

Project homepage: http://sourceforge.net/projects/alphamail
Programming language(s): C++,Java,JavaScript,Perl
License: other

  jcorba/
    IMAPClient.java
    IMAPServer.java
    imap.idl
  Makefile
  cache_entry.cc
  client_socket.cc
  date_time.cc
  imaps_test.cc
  map_test.cc
  memory_bug.cc
  mkdir.cc
  mm.cc
  oop.cc
  parse_response.cc
  regex1.cc
  request_processor.cc
  server_socket.cc
  split.cc
  ssl.c
  ssl_client.cpp